Alarm method and device, computer device, readable storage medium and program product
Patent Information
- Application Number
- CN202510519823.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-23
- Publication Date
- 2026-10-23
AI Technical Summary
[0040]第四方面,本申请还提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述的方法的步骤。
Smart Images

Figure CN122969953A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data security technology, and in particular to an alarm method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Technology
[0002] With the widespread adoption of microservice architectures, Kubernetes (an open-source container orchestration system) has become one of the standard platforms for deploying cloud-native applications. In distributed environments, effectively monitoring the status of various components and issuing timely alerts has become particularly important. Currently, alerting is typically done by manually configuring static rule files. However, this method of alerting based on pre-configured static rule files has limited dynamic adjustment capabilities, limiting alerting to fixed alerting methods defined in the rules. This results in reduced alerting efficiency.
[0003] Therefore, current alarm methods suffer from low alarm efficiency. Summary of the Invention
[0004] Therefore, it is necessary to provide an alarm method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can improve alarm efficiency in response to the above-mentioned technical problems.
[0005] Firstly, this application provides an alarm method, including:
[0006] Obtain the status information corresponding to the component to be monitored;
[0007] The status information is matched with each alarm rule in the alarm configuration corresponding to the target user to obtain the target alarm rule that meets the triggering conditions; the alarm configuration is created by the target user based on the container orchestration system and then input into the monitoring system. The alarm configuration is configured with an alarm information sending address. The alarm rule is received by the monitoring tool corresponding to the container orchestration system and input into the alarm configuration that matches the alarm rule.
[0008] The alarm information program generates corresponding alarm information according to the target alarm rules and sends the alarm information to the communication group corresponding to the alarm information sending address; the alarm information is used to instruct the personnel in the communication group to process the alarm information corresponding to the component.
[0009] In this embodiment, the server generates alarm configurations through a container orchestration system, dynamically refreshes the alarm rules received by the monitoring tool to the matching alarm configurations, determines the target alarm rule in the alarm configuration that meets the triggering conditions based on the component's status information, and sends the alarm information to the corresponding communication group through the alarm program, thereby achieving the technical effect of improving alarm efficiency.
[0010] In one embodiment, the method further includes:
[0011] Obtain the alarm rule attributes carrying rule tags input by the target user through the container orchestration system;
[0012] Based on the rule tags, determine the corresponding alarm information sending address;
[0013] Based on the alarm rule attributes carrying the rule tag and the alarm information sending address, generate the corresponding alarm configuration;
[0014] The alarm configuration is input into the monitoring system through the controller of the container orchestration system.
[0015] In this embodiment, the server can use rule tags to determine the alarm information sending address, use the alarm rule attributes input by the target user, and dynamically generate alarm configurations by combining the alarm rule attributes and the alarm information sending address. This improves the ability to dynamically adjust alarm configurations, thereby improving the efficiency of alarm configuration generation and updating.
[0016] In one embodiment, the method further includes:
[0017] Obtain the alarm rules input by the target user;
[0018] The alarm management tool of the monitoring system is used to match the alarm rules with the rule tags to obtain the corresponding matching results;
[0019] If the matching result meets the matching conditions, the alarm rule is input into the alarm configuration corresponding to the rule tag through the monitoring tool corresponding to the container orchestration system.
[0020] In this embodiment, the server uses an alarm management tool to dynamically associate alarm rules and alarm configurations input by the target user, thereby improving the efficiency and flexibility of alarm rule generation and configuration.
[0021] In one embodiment, the method further includes:
[0022] The network hook address of the communication group corresponding to the alarm configuration is obtained through the alarm management tool of the monitoring system and used as the alarm information sending address.
[0023] Input the network hook address into the network configuration of the alarm information program to be configured;
[0024] The alarm information program is obtained based on the network configuration carrying the network hook address.
[0025] In this embodiment, the server can use an alarm management tool to configure the network of the alarm information program, so that the alarm information program can use the alarm information sending address in the alarm configuration as its own network configuration, thereby improving the configuration efficiency of the alarm information program.
[0026] In one embodiment, the step of generating corresponding alarm information according to the target alarm rule through an alarm information program and sending the alarm information to the communication group corresponding to the alarm information sending address includes:
[0027] The alarm information is generated by the alarm information program according to the preset information template and the target alarm rules;
[0028] The alarm information program determines the network hook address corresponding to the communication group based on the alarm information sending address.
[0029] The alarm information program sends the alarm information to the communication group based on the network hook address.
[0030] In this embodiment, the server can generate alarm information using the information template configured in the alarm information program, and send it to the corresponding communication group in combination with the network hook address, thereby improving the accuracy of alarm information distribution.
[0031] In one embodiment, the method further includes:
[0032] The user's identifier is obtained through the container orchestration system;
[0033] If the container orchestration system determines that the user is an authorized user based on the user identifier, then the user is determined to be the target user.
[0034] In this embodiment, the server detects whether a user is an authorized user by the user identifier and only allows authorized users to configure alarms and edit alarm rules, thereby improving the security of alarms.
[0035] Secondly, this application also provides an alarm device, comprising:
[0036] The acquisition module is used to acquire the status information of the component to be monitored;
[0037] The matching module is used to match the status information with each alarm rule in the alarm configuration corresponding to the target user to obtain the target alarm rule that meets the triggering conditions. The alarm configuration is created by the target user based on the container orchestration system and then input into the monitoring system. The alarm configuration is configured with an alarm information sending address. The alarm rule is received by the monitoring tool corresponding to the container orchestration system and input into the alarm configuration that matches the alarm rule.
[0038] The alarm module is used to generate corresponding alarm information according to the target alarm rules through the alarm information program, and send the alarm information to the communication group corresponding to the alarm information sending address; the alarm information is used to instruct the personnel in the communication group to process the alarm information corresponding to the component.
[0039] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described method.
[0040] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method.
[0041] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described method.
[0042] The aforementioned alarm method, device, computer equipment, computer-readable storage medium, and computer program product, through which the target user creates alarm configurations based on a container orchestration system and inputs them into the monitoring system, configures the alarm information sending address in the alarm configuration, receives alarm rules through the monitoring tool corresponding to the container orchestration system and inputs them into the alarm configuration matching the alarm rules, matches the status information of the component to be monitored with each alarm rule in the target user's alarm configuration to obtain the target alarm rule that meets the triggering conditions, and sends the alarm information corresponding to the target alarm rule to the communication group corresponding to the alarm information address through the alarm information program, so that the personnel in the communication group can process the alarm information. Compared with the traditional alarm method based on pre-configured static rule files, this solution generates alarm configurations through a container orchestration system, dynamically refreshes the alarm rules received by the monitoring tool to the matching alarm configurations, determines the target alarm rule in the alarm configuration that meets the triggering conditions based on the component's status information, and sends the alarm information to the corresponding communication group through the alarm program, thereby achieving the technical effect of improving alarm efficiency. Attached Figure Description
[0043] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0044] Figure 1 This is a flowchart illustrating an alarm method in one embodiment;
[0045] Figure 2 This is a flowchart illustrating the alarm method in another embodiment;
[0046] Figure 3 This is a structural block diagram of an alarm device in one embodiment;
[0047] Figure 4 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0048] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0049] Among related technologies, Kubernetes is the standard platform for deploying cloud-native applications. In a distributed environment, effectively monitoring the status of various components and issuing timely alerts becomes particularly important. Prometheus, as an open-source time-series database and monitoring system, is renowned for its powerful PromQL (Prometheus Query Language) query language and flexible data model. Prometheus alert configuration often relies on manually setting static rule files, while Grafana (a data visualization tool) offers a more user-friendly interface for configuring Prometheus alerts. However, configuring alert rules using static rule files requires users to pre-write alert rule files and load them into the Prometheus server; while simple and direct, this method lacks dynamic adjustment capabilities. Visualization tools like Grafana offer more user-friendly interfaces for configuring Prometheus alerts, but still suffer from a long learning curve and insufficient customization capabilities for specific scenarios.
[0050] Based on this, this application generates alarm configurations through a container orchestration system, dynamically refreshes the alarm rules received by the monitoring tool to the matching alarm configurations, determines the target alarm rules in the alarm configurations that meet the triggering conditions based on the component's status information, and sends the alarm information to the corresponding communication group through the alarm program, thereby achieving the technical effect of improving alarm efficiency.
[0051] In one embodiment, such as Figure 1 As shown, an alarm method is provided. This embodiment illustrates the application of this method to a server, which can consist of a single server or a server cluster composed of multiple servers. It is understood that this method can also be applied to a terminal, and further to a system including both a terminal and a server, and is implemented through the interaction between the terminal and the server, including the following steps S202 to S206. Wherein:
[0052] Step S202: Obtain the status information corresponding to the component to be monitored.
[0053] The aforementioned components can be various components within a distributed cloud platform. To maintain the stable operation of the cloud platform, it is necessary to monitor the status of each component in a timely manner and issue alarms promptly when a component exhibits abnormal status. An alarm is a notification issued when the system detects that a certain triggering condition has been met. This condition is typically a threshold related to performance metrics or a specific event trigger.
[0054] To provide alerts on the status of components, it is necessary to determine the component's status information. For example, the server can obtain the status information corresponding to the component to be monitored. The server can obtain the component's status information at a pre-set period, or it can obtain the status information of the component whose status information has changed when a change is detected.
[0055] Step S204: Match the above status information with each alarm rule in the alarm configuration corresponding to the target user to obtain the target alarm rule that meets the triggering conditions; the above alarm configuration is obtained by the target user after creating it based on the container orchestration system and inputting it into the monitoring system. The above alarm configuration is configured with an alarm information sending address. The above alarm rule is received by the monitoring tool corresponding to the container orchestration system and input into the above alarm configuration that matches the above alarm rule.
[0056] The server can be configured with resources for alarm settings. Alarm configuration refers to setting and adjusting a series of parameters, rules, and conditions to ensure that the system can correctly trigger alarms and take appropriate response measures under specific circumstances. The server is equipped with a container orchestration system, namely Kubernetes. The server allows target users to create alarm configurations based on Kubernetes and input these configurations into the monitoring system. This monitoring system can also be called Prometheus. The target users can be authorized users of the server; that is, the server can use authorized users as target users. The server can determine whether a user belongs to the target user based on the user identifier.
[0057] In one embodiment, the method further includes: obtaining a user identifier through the container orchestration system; if the container orchestration system determines that the user is an authorized user based on the user identifier, then the user is determined to be the target user.
[0058] In this embodiment, the server can determine whether a user is the target user. For example, each user on the server carries a corresponding user identifier. The user identifier represents information such as the user's role and identity on the server. The server obtains the user identifier through the container orchestration system and detects the user identifier. The user identifier includes, but is not limited to, the user identifier corresponding to authorized users and the user identifier corresponding to unauthorized users. Authorized users refer to users authorized by the container orchestration system administrator to configure alarms and input alarm rules; unauthorized users refer to users who have not been authorized by the administrator.
[0059] The server can use the container orchestration system to detect whether the user's identifier belongs to an authorized user. If the server detects that the user's identifier belongs to an authorized user, the server can determine that the user corresponding to the user's identifier is an authorized user, and thus the server can use the user who belongs to the authorized user as the target user.
[0060] In this embodiment, the server detects whether a user is an authorized user by the user identifier and only allows authorized users to configure alarms and edit alarm rules, thereby improving alarm security.
[0061] For target users, the server can receive alert configurations created by them based on the container orchestration system and input corresponding alert rules. The server can receive new alert rules through the monitoring tools corresponding to the aforementioned container orchestration system and input them into the matching alert configurations. These monitoring tools can also be called Prometheus Operator. Prometheus Operator automates the management of Prometheus instances and related monitoring components through a series of CRDs (Custom Resource Definitions) and Controllers. Kubernetes, as a container orchestration platform, allows users to define custom resources to extend its functionality through its extensible API (Application Programming Interface). The aforementioned monitoring tool, Prometheus Operator, can be a type of custom resource. Alert configuration is a crucial part of Prometheus Operator, allowing users to define alert rules that trigger alert notifications when monitoring metrics meet specific conditions.
[0062] The alarm configuration above includes an alarm message sending address. This address represents the address used to send alarm notifications. The server can generate corresponding alarm messages based on the target alarm rules and send them using the aforementioned alarm message sending address. This alarm message sending address can be configured in the alarm configuration using Alertmanager (an alarm management tool) on the server. This alarm management tool can be used to send alarm messages.
[0063] The aforementioned target alarm rules can be determined by the server through alarm rule matching. For example, after obtaining the status information of the aforementioned components, the server can match this status information with each alarm rule in the alarm configuration corresponding to the target user to determine the target alarm rule that meets the triggering conditions. Each alarm rule has a corresponding triggering condition, which indicates the conditions under which an alarm is triggered. Different alarm rules may have different triggering conditions. The aforementioned alarm configurations can be associated with users; for example, each target user can be associated with a corresponding alarm configuration. Alarm configurations for different target users do not need to be mutually accessible. For instance, each alarm configuration may have a namespace, indicating that different target users generate corresponding namespaces for their alarm configurations, thereby meeting the specific needs of different target users for alarm configurations and improving the matching degree between alarm configurations and target users.
[0064] Step S206: The alarm information program generates corresponding alarm information according to the target alarm rules and sends the alarm information to the communication group corresponding to the alarm information sending address; the alarm information is used to instruct the personnel in the communication group to process the alarm information corresponding to the component.
[0065] The server can be configured with an alarm information program, which can generate and send alarm information. The server can configure the alarm information program based on information from the aforementioned alarm management tool to send alarm information. The alarm information can be generated based on a target alarm rule. This target alarm rule can be an alarm rule that meets triggering conditions. For example, when the state of a component changes, causing its parameters to meet the conditions for triggering an alarm rule, that alarm rule can be used as the target alarm rule.
[0066] The server can generate corresponding alarm information based on the target alarm rules using the aforementioned alarm information program. For example, the server can generate alarm information by combining the message template configured in the alarm information program with the target alarm rules. Thus, the server can automatically monitor and send the alarm messages that need to be sent to the communication group corresponding to the alarm information sending address in the aforementioned alarm configuration. The aforementioned alarm information sending address can also be configured in the alarm information program, and the server can configure the alarm information sending address in the alarm information program using the aforementioned alarm management tool. The aforementioned communication group can be a group containing multiple personnel involved in the operation and maintenance of components, such as a chat group. After the alarm information is sent to the aforementioned communication group, the relevant personnel in the communication group can process the alarm information. For example, based on the alarm information, the relevant personnel in the communication group can identify the component that was alarmed, and based on the alarm information, determine the issue for which the component was alarmed, and then process the component according to the issue for which the alarm was alarmed to eliminate the alarm. There can be multiple alarm information sending addresses, and the communication group corresponding to each alarm information sending address can belong to the same platform or different platforms. The alarm information program can send alarm information to the corresponding communication groups based on each alarm information sending address.
[0067] In the aforementioned alarm method, the target user creates an alarm configuration based on the container orchestration system and inputs it into the monitoring system. The alarm configuration specifies the alarm information sending address. The monitoring tool corresponding to the container orchestration system receives alarm rules and inputs them into the alarm configuration that matches the alarm rules. The status information of the component to be monitored is matched with each alarm rule in the target user's alarm configuration to obtain the target alarm rule that meets the triggering conditions. The alarm information program then sends the alarm information corresponding to the target alarm rule to the communication group corresponding to the alarm information address, allowing personnel in the communication group to process the alarm information. Compared to the traditional method of alarming based on pre-configured static rule files, this solution generates alarm configurations through the container orchestration system, dynamically refreshes the alarm rules received by the monitoring tool into the matching alarm configurations, and after determining the target alarm rule in the alarm configuration that meets the triggering conditions based on the component's status information, the alarm program sends the alarm information to the corresponding communication group, thus improving alarm efficiency.
[0068] In one embodiment, the method further includes: obtaining alarm rule attributes carrying rule tags input by the target user through the container orchestration system; determining the corresponding alarm information sending address based on the rule tags; generating a corresponding alarm configuration based on the alarm rule attributes carrying the rule tags and the alarm information sending address; and inputting the alarm configuration into the monitoring system through the controller of the container orchestration system.
[0069] In this embodiment, the server can pre-generate alarm configurations. These configurations can be used to match and associate alarm rules, and the attributes of the alarm rules associated with the configurations can be configured. For example, a target user inputs alarm rule attributes carrying rule tags through the container orchestration system on the server. The server can obtain the alarm rule attributes with rule tags input by the target user through the container orchestration system and obtain the alarm information sending address determined based on the rule tags. These alarm rule attributes can include various types of attributes; the rule tags can be tags representing the alarm types in the alarm configuration, where the alarm type indicates which type of component state triggers an alarm. Therefore, the alarm rules can be matched and associated based on the rule tags in the alarm configuration.
[0070] Different rule tags can be associated with different communication groups, and the alarm message sending address can be determined based on the rule tags. That is, the server uses the alarm message sending address of the associated communication group as the alarm message sending address associated with the alarm configuration. Specifically, the alarm message sending address associated with the alarm configuration can be a Webhook address.
[0071] After determining the alarm rule attributes and alarm information sending address, the server can generate a corresponding alarm configuration based on the alarm rule attributes and alarm information sending address carrying the aforementioned rule tags. This alarm configuration is then input into the monitoring system via the controller of the container orchestration system. The controller can be a unit for monitoring and updating alarm configurations. The monitoring system can include multiple alarm configurations. The controller can update the alarm configurations to the monitoring system according to a preset period, or it can dynamically monitor the generation of alarm configurations and update them to the monitoring system when they are detected.
[0072] Specifically, the aforementioned alarm configuration can be a PrometheusRule (monitoring system rule) resource. The alarm rule attributes include, but are not limited to, namespace, alarm name, PromQL (alarm rule language), annotations, rule tags, and the duration for which alarms are sent. The namespace indicates the target user associated with the alarm configuration; alarm configurations for different target users can be processed independently to improve alarm targeting. The alarm name can be the name of the alarm configuration. The alarm rule language can be the programming language used by the alarm rule associated with the alarm configuration. Annotations can be annotations for the alarm rule. The duration for which alarms are sent indicates the frequency at which alarm information is sent when an alarm is triggered. The server can automatically refresh the alarm configuration file corresponding to the alarm rule.
[0073] For example, an authorized target user creates a PrometheusRule resource via the Kubernetes API (the interface for container orchestration). After submitting the resource, the Prometheus Operator (the monitoring tool) automatically refreshes the alert rules to the alert configuration in the Prometheus service. The Kubernetes administrator grants the target user permission to create PrometheusRule resources within a namespace. When the user submits the PrometheusRule resource configuration, the server verifies the user's permissions through Kubernetes. Upon successful verification, the server automatically refreshes the alert configuration to the Prometheus service through the PrometheusRule resource controller, thus generating the alert configuration. Furthermore, the server can configure the Webhook address and parameters for the alert configuration, enabling the configuration of the aforementioned alert information sending address.
[0074] In this embodiment, the server can use rule tags to determine the alarm information sending address, use the alarm rule attributes input by the target user, and dynamically generate alarm configurations by combining the alarm rule attributes and the alarm information sending address. This improves the ability to dynamically adjust alarm configurations, thereby improving the efficiency of alarm configuration generation and updating.
[0075] In one embodiment, the method further includes: obtaining the alarm rules input by the target user; matching the alarm rules with the rule tags using the alarm management tool of the monitoring system to obtain the corresponding matching results; and if the matching results meet the matching conditions, inputting the alarm rules into the alarm configuration corresponding to the rule tags using the monitoring tool of the container orchestration system.
[0076] In this embodiment, the alarm rules can be associated with alarm configurations through dynamic matching. The authorized target user can input alarm rules into the server. The server can obtain the alarm rules input by the target user. The server can match the alarm rules with various alarm configurations. For example, the server uses the alarm management tool of the monitoring system to match the alarm rules with the rule tags of the alarm configurations to obtain the corresponding matching results. The alarm rules may contain corresponding tags; that is, the server uses the alarm management tool to match the tags in the alarm rules with the rule tags of the alarm configurations.
[0077] If the server detects that the above matching result meets the matching conditions, such as the similarity between the tag in the alarm rule and the rule tag in the alarm configuration being greater than the similarity threshold, the server can determine that the above alarm rule matches the alarm configuration, and input the alarm rule into the alarm configuration corresponding to the above rule tag through the monitoring tool corresponding to the container orchestration system.
[0078] Specifically, the alarm rules input by the target user are dynamically refreshed and associated with the corresponding alarm configurations. The association of alarm rules can be related to operations involving the target user. The alarm management tool includes an `AlertmanagerConfig` resource, which contains a `matchers` field. This field includes the rule labels from the alarm configuration. The server then uses the alarm management tool to match the `matchers` field in `AlertmanagerConfig` with the labels of the alarm rules. For example, the `Prometheus Operator` can automatically refresh the alarm rules to the `Prometheus` service, thus achieving dynamic association between alarm rules and alarm configurations.
[0079] In this embodiment, the server uses an alarm management tool to dynamically associate alarm rules and alarm configurations input by the target user, thereby improving the efficiency and flexibility of alarm rule generation and configuration.
[0080] In one embodiment, the method further includes: obtaining the network hook address of the communication group corresponding to the alarm configuration through the alarm management tool corresponding to the monitoring system, and using it as the alarm information sending address; inputting the network hook address into the network configuration of the alarm information program to be configured; and obtaining the alarm information program based on the network configuration carrying the network hook address.
[0081] In this embodiment, the alarm information program can configure the network based on the alarm configuration. The monitoring system includes an alarm management tool, the alarm configuration is associated with a corresponding communication group, and the alarm configuration contains a network hook address corresponding to the associated communication group. The server can obtain the network hook address of the communication group corresponding to the alarm configuration through the alarm management tool of the monitoring system, and use it as the alarm information sending address. The server needs to configure the network hook address into the alarm information program. For example, the server uses the alarm management tool to input the network hook address into the alarm information program to be configured and the network configuration, and obtains the alarm information program based on the network configuration carrying the network hook address.
[0082] Specifically, the aforementioned alarm information program can be a self-developed software. The server uses this software to send alarm information to a designated communication group. The server needs to configure the alarm information program, such as performing network configuration. This network configuration includes the URL (Uniform Resource Locator) and network parameter settings. The server uses the aforementioned Alertmanager (alarm management tool) to set the URL and network parameters of the alarm program information to the Webhook address configured in the Alertmanager tool. Based on the network configuration carrying the Webhook address, the server obtains the configured alarm information program. The networkhook address configured in the alarm information program can include one or more, meaning the communication group associated with the alarm information program can include one or more.
[0083] Through this embodiment, the server can use alarm management tools to configure the network of the alarm information program, so that the alarm information program can use the alarm information sending address in the alarm configuration as its own network configuration, thereby improving the configuration efficiency of the alarm information program.
[0084] In one embodiment, generating corresponding alarm information according to the target alarm rule through an alarm information program and sending the alarm information to the communication group corresponding to the alarm information sending address includes: generating the alarm information according to a preset information template and the target alarm rule through the alarm information program; determining the network hook address corresponding to the communication group through the alarm information program according to the alarm information sending address; and sending the alarm information to the communication group through the alarm information program according to the network hook address.
[0085] In this embodiment, the server can generate and send alarm information through an alarm information program. This alarm information program includes multiple preset information templates for generating different types of alarm information. The server can then generate alarm information based on the preset information templates and target alarm rules. For example, the server extracts the necessary parameters from the target alarm rules and inputs these parameters into the corresponding preset information templates to obtain the alarm information. The alarm information program is configured with an alarm information sending address, such as the network hook address of a communication group. The server can then determine the network hook address corresponding to the communication group based on the alarm information sending address and send the alarm information to the communication group according to the network hook address.
[0086] The alarm information program can be configured with multiple alarm information sending addresses corresponding to communication groups, so that the server can send alarm information to the corresponding communication groups for notification based on each alarm information sending address.
[0087] Specifically, the aforementioned alarm message program can be a self-developed software with multiple functions. For example, through the alarm message program, the server can send messages to multiple communication groups, customize message templates, set sending keys, and configure silent addresses, among other key options. After the target user completes the configuration of the alarm message program, when the server detects an alarm, the aforementioned communication groups will receive the alarm information.
[0088] In this embodiment, the server can generate alarm information using the information template configured in the alarm information program, and send it to the corresponding communication group in combination with the network hook address, thereby improving the accuracy of alarm information distribution.
[0089] In one exemplary embodiment, such as Figure 2 As shown, Figure 2This is a flowchart illustrating the alarm method in another embodiment. In this embodiment, alarm rules are primarily set using Kubernetes (container orchestration system) custom resources AlertmanagerConfig (alarm management tool configuration) and PrometheusRule (monitoring system rules), and Kubernetes namespaces are used to effectively isolate alarm information. To enhance security and management flexibility, the server implements a user access control mechanism for newly created alarm rules, ensuring that only authorized target users can access or modify related configurations. An alarm message program is set up to support sending alarm information to a communication group specified by the target user via AlertmanagerConfig. This functionality can be achieved simply by setting the URL and parameters of the alarm message program as a Webhook address in AlertmanagerConfig.
[0090] Includes the following steps:
[0091] Step S302: The user submits alarm configuration resources and sets rule tags;
[0092] Step S304: Determine if you have permission to add alarm configurations;
[0093] Step S306: The container orchestration system administrator grants authorization to the user;
[0094] Step S308: Add alarm configuration;
[0095] Step S310: Configure the network hook address and parameters;
[0096] Step S312: The user submits alarm rule resources;
[0097] Step S314: Determine if you have permission to add alarm rules;
[0098] Step S316: The container orchestration system administrator grants authorization to the user;
[0099] Step S318: The monitoring system rule resource for the alarm rule is successfully created, the monitoring system service rule is successfully refreshed, and the alarm rule is associated with the alarm configuration through the tag.
[0100] Step S320: When the alarm triggering condition is met, send alarm information according to the alarm information sending address;
[0101] Step S322: The alarm information program sends alarm information to the communication group according to the alarm information sending address.
[0102] Through the above embodiments, the server generates alarm configurations through a container orchestration system, dynamically refreshes the alarm rules received by the monitoring tool to the matching alarm configurations, determines the target alarm rules in the alarm configurations that meet the triggering conditions based on the component status information, and sends the alarm information to the corresponding communication group through the alarm program, thereby improving the technical effect of alarm efficiency. Furthermore, the server allows authorized target users to customize the authorization scope of the alarm configuration and centrally send alarm information that conforms to a specific set of rules to a designated communication group, which not only enhances permission management but also improves the security and accuracy of alarm distribution.
[0103] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least a portion of the steps or stages of other steps.
[0104] Based on the same inventive concept, this application also provides an alarm device for implementing the alarm method described above. The solution provided by this device is similar to the solution described in the above method. Therefore, the specific limitations in one or more alarm device embodiments provided below can be found in the limitations of the alarm method above, and will not be repeated here.
[0105] In one exemplary embodiment, such as Figure 3 As shown, an alarm device is provided, including: an acquisition module 500, a matching module 502, and an alarm module 504, wherein:
[0106] The acquisition module 500 is used to acquire the status information of the component to be monitored.
[0107] The matching module 502 is used to match the above status information with each alarm rule in the alarm configuration corresponding to the target user to obtain the target alarm rule that meets the triggering conditions. The alarm configuration is created by the target user based on the container orchestration system and then input into the monitoring system. The alarm configuration is configured with an alarm information sending address. The alarm rule is received by the monitoring tool corresponding to the container orchestration system and input into the alarm configuration that matches the alarm rule.
[0108] The alarm module 504 is used to generate corresponding alarm information according to the target alarm rules through the alarm information program, and send the alarm information to the communication group corresponding to the alarm information sending address; the alarm information is used to instruct the personnel in the communication group to process the alarm information corresponding to the component.
[0109] In one embodiment, the apparatus further includes: a first configuration module, configured to acquire alarm rule attributes carrying rule tags input by the target user through the container orchestration system; determine the corresponding alarm information sending address based on the rule tags; generate a corresponding alarm configuration based on the alarm rule attributes carrying the rule tags and the alarm information sending address; and input the alarm configuration into the monitoring system through the controller of the container orchestration system.
[0110] In one embodiment, the above-mentioned apparatus further includes: a second configuration module, configured to acquire the alarm rules input by the target user; match the alarm rules with the rule tags using the alarm management tool of the monitoring system to obtain the corresponding matching results; and if the matching results meet the matching conditions, input the alarm rules into the alarm configuration corresponding to the rule tags using the monitoring tool of the container orchestration system.
[0111] In one embodiment, the above-mentioned device further includes: a third configuration module, configured to obtain the network hook address of the communication group corresponding to the alarm configuration through the alarm management tool corresponding to the monitoring system, and use it as the alarm information sending address; input the network hook address into the network configuration of the alarm information program to be configured; and obtain the alarm information program according to the network configuration carrying the network hook address.
[0112] In one embodiment, the alarm module 504 is configured to generate alarm information according to a preset information template and the target alarm rule through the alarm information program; determine the network hook address corresponding to the communication group according to the alarm information sending address through the alarm information program; and send the alarm information to the communication group according to the network hook address through the alarm information program.
[0113] In one embodiment, the apparatus further includes a detection module, configured to obtain a user identifier of a user through the container orchestration system; if the container orchestration system determines that the user is an authorized user based on the user identifier, then the user is determined to be the target user.
[0114] Each module in the aforementioned alarm device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0115] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 4 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores alarm configuration and alarm rule data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements an alarm method.
[0116] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0117] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the alarm method described above.
[0118] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the alarm method described above.
[0119] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the alarm method described above.
[0120] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0121] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0122] The technical features of the above embodiments can be combined in any way. For the sake of brevity, 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 application.
[0123] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. An alarm method, characterized in that, The method includes: Obtain the status information corresponding to the component to be monitored; The status information is matched with each alarm rule in the alarm configuration corresponding to the target user to obtain the target alarm rule that meets the triggering conditions; the alarm configuration is created by the target user based on the container orchestration system and then input into the monitoring system. The alarm configuration is configured with an alarm information sending address. The alarm rule is received by the monitoring tool corresponding to the container orchestration system and input into the alarm configuration that matches the alarm rule. The alarm information program generates corresponding alarm information according to the target alarm rules and sends the alarm information to the communication group corresponding to the alarm information sending address; the alarm information is used to instruct the personnel in the communication group to process the alarm information corresponding to the component.
2. The method according to claim 1, characterized in that, The method further includes: Obtain the alarm rule attributes carrying rule tags input by the target user through the container orchestration system; Based on the rule tags, determine the corresponding alarm information sending address; Based on the alarm rule attributes carrying the rule tag and the alarm information sending address, generate the corresponding alarm configuration; The alarm configuration is input into the monitoring system through the controller of the container orchestration system.
3. The method according to claim 2, characterized in that, The method further includes: Obtain the alarm rules input by the target user; The alarm management tool of the monitoring system is used to match the alarm rules with the rule tags to obtain the corresponding matching results; If the matching result meets the matching conditions, the alarm rule is input into the alarm configuration corresponding to the rule tag through the monitoring tool corresponding to the container orchestration system.
4. The method according to claim 1, characterized in that, The method further includes: The network hook address of the communication group corresponding to the alarm configuration is obtained through the alarm management tool of the monitoring system and used as the alarm information sending address. Input the network hook address into the network configuration of the alarm information program to be configured; The alarm information program is obtained based on the network configuration carrying the network hook address.
5. The method according to claim 1, characterized in that, The step of generating corresponding alarm information according to the target alarm rule through an alarm information program and sending the alarm information to the communication group corresponding to the alarm information sending address includes: The alarm information is generated by the alarm information program according to the preset information template and the target alarm rules; The alarm information program determines the network hook address corresponding to the communication group based on the alarm information sending address. The alarm information program sends the alarm information to the communication group based on the network hook address.
6. The method according to any one of claims 1 to 5, characterized in that, The method further includes: The user's identifier is obtained through the container orchestration system; If the container orchestration system determines that the user is an authorized user based on the user identifier, then the user is determined to be the target user.
7. An alarm device, characterized in that, The device includes: The acquisition module is used to acquire the status information of the component to be monitored; The matching module is used to match the status information with each alarm rule in the alarm configuration corresponding to the target user to obtain the target alarm rule that meets the triggering conditions. The alarm configuration is created by the target user based on the container orchestration system and then input into the monitoring system. The alarm configuration is configured with an alarm information sending address. The alarm rule is received by the monitoring tool corresponding to the container orchestration system and input into the alarm configuration that matches the alarm rule. The alarm module is used to generate corresponding alarm information according to the target alarm rules through the alarm information program, and send the alarm information to the communication group corresponding to the alarm information sending address; the alarm information is used to instruct the personnel in the communication group to process the alarm information corresponding to the component.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.