WO2020000676A1 - Database automatic alarming method and apparatus, terminal device, and readable storage medium - Google Patents

Database automatic alarming method and apparatus, terminal device, and readable storage medium Download PDF

Info

Publication number
WO2020000676A1
WO2020000676A1 PCT/CN2018/105555 CN2018105555W WO2020000676A1 WO 2020000676 A1 WO2020000676 A1 WO 2020000676A1 CN 2018105555 W CN2018105555 W CN 2018105555W WO 2020000676 A1 WO2020000676 A1 WO 2020000676A1
Authority
WO
WIPO (PCT)
Prior art keywords
alarm
configuration
information
target
item
Prior art date
Application number
PCT/CN2018/105555
Other languages
French (fr)
Chinese (zh)
Inventor
孙泽祥
梁海安
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2020000676A1 publication Critical patent/WO2020000676A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3089Monitoring arrangements determined by the means or processing involved in sensing the monitored data, e.g. interfaces, connectors, sensors, probes, agents
    • G06F11/3093Configuration details thereof, e.g. installation, enabling, spatial arrangement of the probes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/32Monitoring with visual or acoustical indication of the functioning of the machine
    • G06F11/324Display of status information
    • G06F11/327Alarm or error message display

Definitions

  • the present application belongs to the technical field of data processing, and particularly relates to a method, a device, a terminal device, and a computer-readable storage medium for automatic alarming of a database.
  • a database is a warehouse that organizes, stores, and manages data according to the data structure.
  • the database is monitored to ensure the security of the database operation.
  • an alert needs to be sent to the designated object to serve as a reminder. For example, after monitoring the performance parameters of the database exceeding the threshold, the performance parameters are sent to the corresponding operation and maintenance personnel.
  • an alarm process is usually configured inside the monitored database.
  • the alarm mechanism of the database is configured according to the existing technology, the alarm mechanism needs to be configured in each database, the configuration efficiency is low, and after the configuration is completed, if the alarm object of a database needs to be changed, you need to find the The database finds the configuration code inside the database and changes the configuration code, so the configuration of the database alarm mechanism in the prior art is inefficient and inconvenient to change.
  • the embodiments of the present application provide a method, an apparatus, a terminal device, and a computer-readable storage medium for automatic database alarm, so as to solve the problem of low configuration efficiency of the database alarm mechanism in the prior art and inconvenience of changing the alarm target.
  • a first aspect of the embodiments of the present application provides a method for automatically alarming a database, including:
  • Acquiring configuration information related to a target database to which an alarm is to be set the configuration information including identification information of the target database and an alarm target corresponding to the target database;
  • CMDB configuration management database
  • the identification information is stored in the configuration item
  • the alarm target is stored in a configuration attribute corresponding to the configuration item ;
  • the current parameters include characteristic information of the target database, operations per second, and current traffic, and the characteristic information includes a name of the target database;
  • a second aspect of the embodiments of the present application provides a device for automatic database alarm, which may include a unit for implementing the steps of the above method for automatic database alarm.
  • a third aspect of the embodiments of the present application provides a terminal device including a memory and a processor.
  • the memory stores computer-readable instructions executable on the processor, and the processor executes the computer-readable instructions. The steps of the method for realizing the automatic alarm of the database when the instruction is read.
  • a fourth aspect of the embodiments of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, a method for implementing the above-mentioned database automatic alarm A step of.
  • the embodiment of the present application first obtains configuration information including identification information and alarm targets related to the target database to be set for alarms, and builds a configuration management database CMDB according to the configuration information. After the construction is completed, identification information is stored in the configuration items of the CMDB. An alarm target is stored in the configuration property corresponding to the item, and then the current parameters of the target database are obtained and alarm information is generated. The script file is searched to find the configuration item corresponding to the alarm information in the CMDB, and the corresponding configuration item is found from the found configuration item. The alarm target is obtained in the configuration properties and the alarm information is sent to the alarm target.
  • the configuration items and configuration properties are centrally configured in the CMDB.
  • FIG. 1 is a flowchart of a method for automatically alarming a database in Embodiment 1 of the present application;
  • FIG. 2 is a flowchart of a method for automatically alarming a database in a second embodiment of the present application
  • FIG. 3 is a flowchart of a method for automatically alarming a database in a third embodiment of the present application.
  • FIG. 4 is a flowchart of a method for automatically alarming a database in a fourth embodiment of the present application.
  • FIG. 5 is a flowchart of a method for automatically alarming a database in a fifth embodiment of the present application.
  • FIG. 6 is a structural block diagram of a database automatic alarm device in Embodiment 6 of the present application.
  • FIG. 7 is a schematic diagram of a terminal device in Embodiment 7 of the present application.
  • FIG. 1 is a flowchart of a method for automatically alarming a database provided by an embodiment of the present application. As shown in Figure 1, the method includes the following steps:
  • S101 Acquire configuration information related to a target database to which an alarm is to be set, where the configuration information includes identification information of the target database and an alarm target corresponding to the target database.
  • configuration information related to the target database is obtained.
  • the configuration information includes identification information of the target database and an alarm target corresponding to the target database.
  • the target database refers to a database to be set for an alarm.
  • the target database may be One or more; identification information refers to the information related to the target database used to identify the target database, such as the name or address of the target database; alert target refers to the object to be alerted, the format can be the target email account number or the target mobile phone number Wait. It is worth mentioning that a storage address can be specified in advance and configuration information can be obtained periodically from the storage address.
  • S102 Construct a configuration management database CMDB according to the configuration information, wherein the CMDB corresponds to a configuration item, the identification information is stored in the configuration item, and the configuration attribute corresponding to the configuration item stores the Alarm target.
  • CMDB Configuration Management Database
  • ITIL Information Technology Infrastructure Library
  • the specific process of storing the configuration information in the CMDB is to store the identification information in the configuration information to the configuration item in the CMDB, and store the alarm target in the configuration information to the configuration attribute corresponding to the above configuration item in the CMDB, in the CMDB
  • the configuration items are used to indicate the resources to be managed by the CMDB, and the configuration attributes are used to describe the configuration items.
  • the configuration information is obtained through a preset information system.
  • the CMDB can be connected to a preset information system in advance, and the configuration information can be entered into the information system, and the information system can be set in advance at regular intervals or when the configuration information is updated.
  • the communication between the CMDB and the information system can be achieved through the SaltStack tool.
  • S103 Acquire current parameters of the target database, where the current parameters include characteristic information of the target database, operations per second, and current traffic, and the characteristic information includes a name of the target database.
  • the target database After the CMDB is constructed, the target database includes feature information, Operation Per Second (OPS), and current parameters of the current traffic.
  • the current parameters can be obtained by monitoring the target database.
  • the feature information and identification information The format is the same, that is, if the format of the identification information is a name, the format of the characteristic information is also a name; the number of operations per second refers to the number of additions, deletions, changes, and query operations to the target database per second; the current traffic refers to the target The flow of data input and output by the database per second.
  • a structured query language Structured Query
  • the current parameters may not be limited to the above-mentioned characteristic information, the number of operations per second, and the current traffic, such as the number of database connections (the current number of all threads in the database) and the table space occupation rate.
  • the target database is monitored by a preset monitoring system.
  • the monitoring operation of the target database may be completed in a monitoring system.
  • the monitoring system may be a system that manages the host where the target database is located, and an SQL statement related to the monitoring operation is added.
  • the monitoring is performed by setting a separate monitoring system.
  • the target database realizes the functional isolation of each system and improves the fault tolerance of monitoring.
  • the preset condition may be a preset threshold of the number of operations per second and a threshold of the current traffic. If the current parameters meet the preset conditions, that is, the number of operations per second and the current traffic in the current parameters are greater than or equal to the corresponding threshold, an alarm message is generated, and the alarm message is usually in text format. It is worth mentioning that, based on the current parameters, the alarm information can also include the time when the alarm information was generated and the related information of the monitoring system monitoring the target database.
  • S105 Find a configuration item corresponding to the identification information in the CMDB that matches the characteristic information in the alarm information by executing a preset script file, and obtain a corresponding alarm from the configuration attribute of the found configuration item. A target, and sending the alarm information to the obtained alarm target.
  • the transmission of alarm information is implemented by executing a preset script file. Specifically, during the execution of the script file, according to the characteristic information of the alarm information, it is found whether there is a configuration item in the CMDB and the identifier of the configuration item. The information is the same as the characteristic information. If it exists, the alarm target is obtained from the configuration attribute corresponding to the configuration item, and the alarm information is automatically sent to the alarm target. Multiple sending methods can be preset in the script file, so when the script file is executed, the corresponding sending method is automatically adopted according to the type of the alarm target.
  • a corresponding sending method is based on any preset email account and password (which can be the email account and password of the host executing the script file) that can communicate normally.
  • the alarm information is added to the email to be sent to this email account, and the email to be sent is automatically sent to the target email account.
  • a judgment mechanism can be set before the code for sending the alarm information in the script file. The judgment mechanism is used to determine whether the alarm target was successfully obtained. If the acquisition is successful, the alarm information is sent during the execution of the script file. If it fails, a failure prompt containing alarm information is output.
  • the script file is written in python language. Since the python language is easy to use and extensible, it can be applied in this embodiment.
  • the embodiment of the present application realizes automatic alarming of the database by constructing a CMDB, which improves the configuration efficiency of the database alarm mechanism, and if the target of the alarm is to be changed, the configuration in the CMDB can be directly changed. Improved the convenience of changing alert targets.
  • FIG. 2 is a flowchart of implementing a database automatic alarm method provided in Embodiment 2 of the present application.
  • this embodiment refines S102 on the basis that the configuration information includes identification information and multiple alarm information groups, and each alarm information group includes an alarm target and an alarm threshold corresponding to the alarm target.
  • S201 ⁇ S203 are obtained later, as follows:
  • S201 Construct the CMDB according to the configuration information, wherein the identification information is stored in the configuration item, the configuration item corresponds to a plurality of the configuration attributes, and each of the configuration attributes is stored in One said alarm information group.
  • the obtained configuration information includes identification information of the target database and a plurality of alarm information groups corresponding to the target database, where each alarm information group includes an alarm target and an alarm threshold corresponding to the alarm target.
  • the specific process in the information construction CMDB is to store the identification information in the configuration information to the configuration item in the CMDB, and store multiple alarm information groups in the configuration information to the multiple configuration attributes corresponding to the configuration item in the CMDB. , Where each configuration property stores an alarm information group.
  • S202 Analyze the alarm information to obtain an alarm value of the alarm information, where the alarm value indicates the severity of the alarm information.
  • the preset script file is different from the script file in the first embodiment of the present application.
  • the script file in the embodiment of the present application if the alarm information has been obtained , Find the configuration item corresponding to the identification information in the CMDB that is the same as the characteristic information in the alarm information, and analyze the alarm information to obtain the alarm value of the alarm information.
  • An analysis method for analyzing alarm information is to obtain preset multiple times intervals corresponding to the number of operations per second and multiple traffic intervals corresponding to the current traffic. Each times interval and each traffic interval include interval values.
  • the alarm value is obtained by judging the frequency interval to which the number of operations per second in the alarm information belongs and the flow interval to which the current traffic in the alarm information belongs, and adding the interval value of the number of times interval and the interval value of the flow interval to which the alarm value belongs.
  • the preset conditions for determining whether to generate alarm information are 5 operations per second
  • the current traffic is 3KB
  • the number of times corresponding to the number of operations per second includes 5 to 10 operations per second.
  • the number of times, the interval value is 0; the number of operations per second is 11 to 15 times, the interval value is 1; the number of operations per second is 16 times or more, the interval value is 2.
  • the multiple traffic ranges corresponding to the current traffic include the current traffic ranges from 3KB to 5KB, and the interval value is 0; the current traffic ranges from 6KB to 9KB, and the interval value is 1; the current traffic ranges from 10KB and above 10KB, The interval value is 2.
  • the alarm value indicates the severity of the alarm information. The higher the alarm value, the higher the severity.
  • different multiple times intervals and multiple traffic intervals are set according to different feature information of different target databases.
  • Info feature-1 corresponding to the plurality of frequency interval Interval Times1-1, Interval Times1-2 and Interval Times1-3, traffic interval corresponding to the plurality of Interval Data1-1, Interval Data1-2 and Interval Data1- 3 ;
  • the feature information is multiple times intervals corresponding to Info feature-2 are Interval Times2-1 , Interval Times2-2, and Interval Times2-3
  • the corresponding multiple traffic intervals are Interval Data2-1 , Interval Data2-2, and Interval Data2 -3 .
  • the corresponding multiple times intervals Interval Times2-1 , Interval Times2-2 and Interval Times2-3 and the corresponding multiple traffic intervals Interval Data2-1 and Interval are passed .
  • Data2-2 and Interval Data2-3 analyze the alarm information to obtain the alarm value, and realize the difference analysis of the alarm information of different target databases.
  • S203 Traversing the alarm information group in the multiple configuration attributes corresponding to the found configuration item, traverses all alarm information groups in the alarm information group corresponding to the alarm threshold that is less than or equal to the alarm value.
  • the alarm target is added to the target set, and the alarm information is sent to the alarm target in the target set.
  • the target set After calculating the alarm value of the alarm information, traverse multiple configuration attributes corresponding to the found configuration item, and compare the alarm threshold of the alarm information group in each configuration attribute with the alarm value. If the alarm threshold is less than or equal to the alarm value , The alarm target in the alarm information group to which the alarm threshold belongs is added to the target set; if the alarm threshold is greater than the alarm value, the alarm value is continuously compared with the alarm threshold of the alarm information group in the next configuration attribute in the CMDB. After the traversal of multiple configuration attributes corresponding to the configuration items is completed, the target set is completed, and the alarm information is sent to all alarm targets in the target set.
  • FIG. 3 is a flowchart of implementing a method for automatically alarming a database provided in Embodiment 3 of the present application.
  • this embodiment further refines S201 to obtain S301 to S302 on the basis that the configuration information further includes multiple weights corresponding to the current parameters, as follows:
  • S301 Construct the CMDB according to the configuration information, wherein the identification information is stored in the configuration item, the configuration item corresponds to a plurality of the configuration attributes, and each of the configuration attributes is stored in One alarm information group and the plurality of weights.
  • the configuration information may be preset to include multiple weights corresponding to the current parameters, and
  • the identification information in the configuration information is stored in the configuration items of the CMDB, and multiple alarm information groups in the configuration information are respectively stored in multiple configuration attributes corresponding to the configuration items, where each configuration attribute An alarm information group is stored in the alarm information group, and multiple weights in the configuration information are stored in each configuration attribute corresponding to the configuration item. After the storage is completed, multiple weights are stored in each configuration attribute.
  • the configuration item corresponding to the identification information in the CMDB that matches the characteristic information in the alarm information is searched, and any one of the configuration items corresponding to the found configuration item is obtained.
  • the plurality of weights in the configuration attribute are obtained by weighting and adding the alarm information based on the plurality of weights to obtain the alarm value.
  • the alarm After storing multiple weights to multiple configuration attributes in the CMDB, and after the alarm information is generated, analyze the alarm information to find the configuration item in the CMDB, the identification information of the configuration item and the characteristic information in the alarm information Match. Obtain multiple weights in any one of the configuration attributes corresponding to the found configuration item, and perform weighted summation of the alarm information based on the multiple weights.
  • the alarm may be determined first according to the analysis method in step S202. The interval value of the interval of the number of operations per second in the information and the interval value of the current interval of the current traffic in the alarm information, and then the interval value is weighted according to the weight corresponding to the number of operations per second and the weight corresponding to the current traffic. And, the obtained result is used as the alarm value.
  • the interval of the number of operations per second in the alarm information is Value Interval-1
  • the interval of the current interval in the alarm information is Value Interval-2
  • the CMDB stores the number of operations per second.
  • the corresponding weight value is Weight Times and the weight value corresponding to the current traffic is Weight Data .
  • FIG. 4 is a flowchart of implementing a database automatic alarm method provided in Embodiment 4 of the present application. Compared with the embodiment corresponding to FIG. 1, this embodiment refines S103 to obtain S401 to S403, which are detailed as follows:
  • the monitoring of the target database is implemented by zabbix.
  • zabbix is an open source distributed monitoring system, which is applicable to the scenario where one or more target databases exist.
  • Zabbix mainly includes a zabbix server and a zabbix client.
  • the zabbix server is a core component of zabbix and is responsible for receiving data sent by the zabbix client.
  • the zabbix client is deployed on the monitored host and is used to collect data from the host.
  • a zabbix server is established on a host (a host operated by a user) that needs to view current parameters, and a zabbix client is established on the host where the target database is located.
  • the establishment process can be implemented by installing a zabbix installation package.
  • S402 Create a zabbix monitoring item, and the monitoring target of the zabbix monitoring item is the target database in the zabbix client.
  • the monitoring script includes a shell statement for detecting the current parameters.
  • the monitoring script After writing, add the monitoring script to the zabbix client configuration file (usually named zabbix_agentd.conf) as a custom key and restart the zabbix client.
  • keys and monitoring items are usually matched, that is, if you want to obtain the data corresponding to the monitoring item, you must use the key to get. Therefore, after successfully generating a custom key for obtaining the current parameters, a monitoring item containing the key is established on the zabbix server.
  • the zabbix server can obtain the current parameters of the target database. It is worth mentioning that the running time or running interval of the monitoring items can also be set to meet the acquisition requirements of the current parameters, such as running the monitoring item at 8 o'clock every morning or running the monitoring item every half an hour.
  • the execution permission is given to the zabbix monitoring item once, that is, when the zabbix server detects that data is obtained through the zabbix monitoring item, it stops giving the execution permission to the zabbix monitoring item.
  • the format of the data obtained through the zabbix monitoring item is compared with the format of the current parameter. If the format of the data obtained through the zabbix monitoring item is the same as the format of the current parameter, the data obtained by the zabbix monitoring item is deemed to be correct, zabbix
  • the server gives the Zabbix monitoring item the execution permission for automatic execution, and the Zabbix monitoring item runs automatically according to the set running time or running interval.
  • the embodiment of the present application uses zabbix technology to obtain the current parameters of the target database. Due to the distributed nature of zabbix, it is applicable to scenarios where multiple target databases exist, which improves the applicability of current parameter acquisition Sex.
  • FIG. 5 is a flowchart of a method for automatically alarming a database provided in Embodiment 5 of the present application.
  • this embodiment refines S104 to obtain S501 to S502 on the basis of preset conditions including multiple alarm levels, as follows:
  • S501 Determine the alarm level that the current parameter complies with from the multiple alarm levels.
  • the preset condition includes multiple alarm levels, and the alarm levels indicate the severity of the current parameters, such as safety, minor, severe, and critical.
  • multiple alarm intervals corresponding to multiple alarm levels are set, and the alarm level is determined by judging the alarm interval to which the current parameter belongs.
  • each alarm interval includes each The value range of the number of operations in seconds and the value range of the current traffic.
  • the alarm level is mild, and the corresponding alarm interval is: 2 to 4 operations per second, and the current traffic is 2KB to 4KB; the alarm level is severe, and the corresponding alarm interval is: 5 to 5 operations per second.
  • the current traffic is 5KB to 6KB. If the number of operations per second in the current parameter is 3 and the current traffic is 3KB, the alarm level that the current parameter meets is minor. It is worth mentioning that if the alarm level corresponding to the current parameter cannot be determined, an alarm prompt is output.
  • S502 Add the alarm level and the current parameter that the current parameters meet to a preset alarm information template to generate the alarm information.
  • the alarm information template can be:
  • the above A, B, C, and D indicate unknown parameters. Adding the alarm level and current parameters to the alarm information template is to replace the alarm levels and current parameters with the corresponding A, B, C, and D in the alarm information template. Generate alarm information.
  • the preset condition includes multiple alarm levels.
  • the process of generating alarm information is specifically determining the current alarm level from multiple alarm levels.
  • the alarm level that the parameters meet adds the current alarm level and the current parameters to the preset alarm information template, generates alarm information, and improves the recognizability of the alarm information.
  • FIG. 6 shows a structural block diagram of a database automatic alarming device provided by an embodiment of the present application.
  • the device includes:
  • the first obtaining unit 61 is configured to obtain configuration information related to a target database to which an alarm is to be set, where the configuration information includes identification information of the target database and an alarm target corresponding to the target database;
  • a construction unit 62 is configured to construct a configuration management database CMDB according to the configuration information, wherein the CMDB corresponds to a configuration item, the configuration item stores the identification information, and the configuration attribute corresponding to the configuration item stores The alarm target is entered;
  • a second obtaining unit 63 configured to obtain current parameters of the target database, where the current parameters include characteristic information of the target database, operations per second, and current traffic, and the characteristic information includes a name of the target database;
  • a generating unit 64 configured to generate alarm information including the current parameter when the current parameter meets a preset condition
  • the execution unit 65 is configured to find, by executing a preset script file, a configuration item corresponding to the identification information in the CMDB that matches the characteristic information in the alarm information, and from the configuration attributes of the found configuration item, Acquire a corresponding alarm target, and send the alarm information to the acquired alarm target.
  • the configuration information includes the identification information and multiple alarm information groups, and each of the alarm information groups includes the alarm target and an alarm threshold corresponding to the alarm target, and the constructing unit 62 includes :
  • a first constructing subunit configured to construct the CMDB according to the configuration information, wherein the configuration item stores the identification information, and the configuration item corresponds to a plurality of the configuration attributes, each of which One configuration of the alarm information group is stored in the configuration attribute;
  • the execution unit 65 includes:
  • An analysis unit configured to analyze the alarm information to obtain an alarm value of the alarm information, where the alarm value indicates a severity of the alarm information
  • the traversal unit is configured to traverse the alarm information group in the plurality of configuration attributes corresponding to the found configuration item, and the alarm information group corresponding to the alarm threshold value that is less than or equal to the alarm value
  • the alarm target in is added to a target set, and the alarm information is sent to the alarm target in the target set.
  • the configuration information further includes multiple weights corresponding to the current parameters
  • the constructing unit 62 includes:
  • a second construction subunit is configured to construct the CMDB according to the configuration information, wherein the identification information is stored in the configuration item, and the configuration item corresponds to a plurality of the configuration attributes, each of which One configuration of the alarm information group and the plurality of weight values are stored in the configuration attributes;
  • the analysis unit includes:
  • a searching unit configured to search the configuration item corresponding to the identification information in the CMDB that matches the characteristic information in the alarm information, and obtain any one corresponding to the found configuration item
  • the plurality of weight values in the configuration attribute are obtained by weighting and adding the alarm information based on the plurality of weight values to obtain the alarm value.
  • the second obtaining unit 63 includes:
  • a creating unit configured to create a zabbix monitoring item, and a monitoring target of the zabbix monitoring item is the target database in the zabbix client;
  • the assigning unit is configured to assign an execution permission to the Zabbix monitoring item once.
  • the Zabbix monitoring item is given an automatic execution execution permission.
  • the preset condition includes multiple alarm levels
  • the generating unit 64 includes:
  • a level determining unit configured to determine, from the multiple alarm levels, the alarm level that the current parameter complies with
  • An adding unit is configured to add the alarm level and the current parameter that the current parameters meet to a preset alarm information template to generate the alarm information.
  • FIG. 7 is a schematic diagram of a terminal device according to an embodiment of the present application.
  • the terminal device 7 of this embodiment includes a processor 70 and a memory 71.
  • the memory 71 stores computer-readable instructions 72 that can be run on the processor 70, such as a database for automatic alarm. program.
  • the processor 70 executes the computer-readable instructions 72, the steps in the method embodiment for implementing the automatic alarm of each database described above, for example, steps S101 to S105 shown in FIG.
  • the processor 70 executes the computer-readable instructions 72
  • the functions of the units in the foregoing device embodiments are implemented, for example, the functions of the units 61 to 65 shown in FIG. 6.
  • the computer-readable instructions 72 may be divided into one or more modules / units, the one or more modules / units are stored in the memory 71 and executed by the processor 70, To complete this application.
  • the one or more modules / units may be a series of computer-readable instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer-readable instructions 72 in the terminal device 7.
  • the computer-readable instructions 72 may be divided into a first acquisition unit, a construction unit, a second acquisition unit, a generation unit, and an execution unit, and the specific functions of each unit are as described above.
  • the terminal device may include, but is not limited to, a processor 70 and a memory 71.
  • FIG. 7 is only an example of the terminal device 7 and does not constitute a limitation on the terminal device 7. It may include more or fewer components than shown in the figure, or combine some components or different components.
  • the terminal device may further include an input / output device, a network access device, a bus, and the like.
  • the processor 70 may be a central processing unit (Central Processing Unit (CPU), or other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (Application Specific Integrated Circuits) Specific Integrated Circuit (ASIC), off-the-shelf Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • CPU Central Processing Unit
  • DSP Digital Signal Processor
  • ASIC Application Specific Integrated Circuits
  • FPGA off-the-shelf Programmable Gate Array
  • a general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the memory 71 may be an internal storage unit of the terminal device 7, such as a hard disk or a memory of the terminal device 7.
  • the memory 71 may also be an external storage device of the terminal device 7, such as a plug-in hard disk, a smart memory card (SMC), and a secure digital (SD) provided on the terminal device 7. Card, flash card, etc. Further, the memory 71 may further include both an internal storage unit of the terminal device 7 and an external storage device.
  • the memory 71 is configured to store the computer-readable instructions and other programs and data required by the terminal device.
  • the memory 71 may also be used to temporarily store data that has been output or is to be output.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each of the units may exist separately physically, or two or more units may be integrated into one unit.
  • the above integrated unit may be implemented in the form of hardware or in the form of software functional unit.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium.
  • the technical solution of the present application is essentially a part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium , Including a number of instructions to enable a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in the embodiments of the present application.
  • the foregoing storage media include: U disks, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or compact discs, and other media that can store program codes .

Abstract

The solution is applicable to the technical field of data processing. Provided are a database automatic alarming method and apparatus, a terminal device, and a computer readable storage medium. The method comprises: obtaining configuration information which is related to a target database and comprises identification information and an alarm target; constructing a configuration management database (CMDB) according to the configuration information, wherein the CMDB corresponds to a configuration item, the identification information is stored in the configuration item, and the alarm target is stored in a configuration property corresponding to the configuration item; obtaining a current parameter, containing characteristic information, of the target database; when the current parameter meets a preset condition, generating alarm information containing the current parameter; searching, in the CMDB, for the configuration item corresponding to the identification information that coincides with the characteristic information in the alarm information by executing a preset script file, obtaining a corresponding alarm target from the searched configuration property of the configuration item, and sending the alarm information to the obtained alarm target. The solution improves configuration efficiency of a database alarming mechanism and the convenience of changing the alarm target.

Description

数据库自动告警的方法、装置、终端设备及可读存储介质Method, device, terminal equipment and readable storage medium for automatic alarm of database
本申请要求于2018年06月27日提交中国专利局、申请号为201810675189.2、发明名称为“数据库自动告警的方法及终端设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority from a Chinese patent application filed on June 27, 2018 with the Chinese Patent Office, application number 201810675189.2 and invention name "Database Automatic Alarm Method and Terminal Device", the entire contents of which are incorporated herein by reference in.
技术领域Technical field
本申请属于数据处理技术领域,尤其涉及一种数据库自动告警的方法、装置、终端设备及计算机可读存储介质。The present application belongs to the technical field of data processing, and particularly relates to a method, a device, a terminal device, and a computer-readable storage medium for automatic alarming of a database.
背景技术Background technique
数据库是按照数据结构来组织、存储和管理数据的仓库,在实际业务场景中,对数据库进行监控,以保障数据库运行的安全性。在数据库出现问题时,需要向指定的对象发送告警,以起到提醒作用。比如说,在监控到数据库的性能参数超出阈值后,将性能参数发送至对应的运维人员。A database is a warehouse that organizes, stores, and manages data according to the data structure. In actual business scenarios, the database is monitored to ensure the security of the database operation. When a problem occurs in the database, an alert needs to be sent to the designated object to serve as a reminder. For example, after monitoring the performance parameters of the database exceeding the threshold, the performance parameters are sent to the corresponding operation and maintenance personnel.
在现有技术中,通常是在被监控的数据库内部配置告警过程。随着业务场景朝着复杂化方向发展,往往存在多个数据库,并且不同的人员需要管理不同的数据库。如果按照现有技术对数据库的告警机制进行配置,则需要在每个数据库内都配置告警机制,配置效率低,并且在配置完成后,如果某个数据库的告警对象需要更改,则需要查找到该数据库,再查找到该数据库内部的配置代码,对配置代码进行更改,故现有技术中数据库告警机制的配置效率低,并且不便更改。In the prior art, an alarm process is usually configured inside the monitored database. As business scenarios evolve toward complexity, multiple databases often exist, and different people need to manage different databases. If the alarm mechanism of the database is configured according to the existing technology, the alarm mechanism needs to be configured in each database, the configuration efficiency is low, and after the configuration is completed, if the alarm object of a database needs to be changed, you need to find the The database finds the configuration code inside the database and changes the configuration code, so the configuration of the database alarm mechanism in the prior art is inefficient and inconvenient to change.
技术问题technical problem
有鉴于此,本申请实施例提供了一种数据库自动告警的方法、装置、终端设备及计算机可读存储介质,以解决现有技术中数据库告警机制的配置效率低,不便更改告警目标的问题。In view of this, the embodiments of the present application provide a method, an apparatus, a terminal device, and a computer-readable storage medium for automatic database alarm, so as to solve the problem of low configuration efficiency of the database alarm mechanism in the prior art and inconvenience of changing the alarm target.
技术解决方案Technical solutions
本申请实施例的第一方面提供了一种数据库自动告警的方法,包括:A first aspect of the embodiments of the present application provides a method for automatically alarming a database, including:
获取与待设置告警的目标数据库相关的配置信息,所述配置信息包括目标数据库的标识信息和与所述目标数据库对应的告警目标;Acquiring configuration information related to a target database to which an alarm is to be set, the configuration information including identification information of the target database and an alarm target corresponding to the target database;
根据所述配置信息构建配置管理数据库CMDB,其中,所述CMDB对应有配置项,所述配置项中存入有所述标识信息,所述配置项对应的配置属性中存入有所述告警目标;Build a configuration management database CMDB according to the configuration information, wherein the CMDB corresponds to a configuration item, the identification information is stored in the configuration item, and the alarm target is stored in a configuration attribute corresponding to the configuration item ;
获取所述目标数据库的当前参数,所述当前参数包括所述目标数据库的特征信息、每秒操作次数以及当前流量,所述特征信息包括所述目标数据库的名称;Acquiring current parameters of the target database, where the current parameters include characteristic information of the target database, operations per second, and current traffic, and the characteristic information includes a name of the target database;
当所述当前参数符合预设条件时,生成包含所述当前参数的告警信息;When the current parameter meets a preset condition, generating alarm information including the current parameter;
通过执行预设的脚本文件查找所述CMDB中与所述告警信息中的所述特征信息相符的标识信息所对应的配置项,并从查找出的配置项的配置属性中获取对应的告警目标,将所述告警信息发送至获取到的告警目标。Find a configuration item corresponding to the identification information in the CMDB that matches the characteristic information in the alarm information by executing a preset script file, and obtain a corresponding alarm target from the configuration attribute of the found configuration item, And sending the alarm information to the acquired alarm target.
本申请实施例的第二方面提供了一种数据库自动告警的装置,可以包括用于实现上述数据库自动告警的方法的步骤的单元。A second aspect of the embodiments of the present application provides a device for automatic database alarm, which may include a unit for implementing the steps of the above method for automatic database alarm.
本申请实施例的第三方面提供了一种终端设备,包括存储器以及处理器,所述存储器中存储有可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现上述数据库自动告警的方法的步骤。A third aspect of the embodiments of the present application provides a terminal device including a memory and a processor. The memory stores computer-readable instructions executable on the processor, and the processor executes the computer-readable instructions. The steps of the method for realizing the automatic alarm of the database when the instruction is read.
本申请实施例的第四方面提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可读指令,所述计算机可读指令被处理器执行时实现上述数据库自动告警的方法的步骤。A fourth aspect of the embodiments of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, a method for implementing the above-mentioned database automatic alarm A step of.
有益效果Beneficial effect
本申请实施例首先获取与待设置告警的目标数据库相关的包括标识信息和告警目标的配置信息,并根据配置信息构建配置管理数据库CMDB,构建完成后CMDB的配置项中存入有标识信息,配置项对应的配置属性中存入有告警目标,然后获取目标数据库的当前参数并生成告警信息,通过执行脚本文件查找CMDB中查找到与告警信息对应的配置项,并从查找出的配置项对应的配置属性中获取告警目标,将告警信息发送至告警目标,本申请实施例通过在CMDB中集中配置配置项和配置属性,较之在目标数据库中单独设置告警目标,更便于设置,在需要更改告警目标时也不用查找目标数据库的配置文件并进行更改,而是直接在CMDB中更改即可,实现了数据库的自动告警,提升了数据库告警机制的配置效率和更改效率。The embodiment of the present application first obtains configuration information including identification information and alarm targets related to the target database to be set for alarms, and builds a configuration management database CMDB according to the configuration information. After the construction is completed, identification information is stored in the configuration items of the CMDB. An alarm target is stored in the configuration property corresponding to the item, and then the current parameters of the target database are obtained and alarm information is generated. The script file is searched to find the configuration item corresponding to the alarm information in the CMDB, and the corresponding configuration item is found from the found configuration item. The alarm target is obtained in the configuration properties and the alarm information is sent to the alarm target. In the embodiment of the present application, the configuration items and configuration properties are centrally configured in the CMDB. Compared with setting the alarm target separately in the target database, it is easier to set and change the alarm when needed It is not necessary to find the configuration file of the target database and change it when it is targeted. Instead, it can be changed directly in the CMDB, which realizes the automatic alarm of the database and improves the configuration efficiency and change efficiency of the database alarm mechanism.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1是本申请实施例一中数据库自动告警的方法的实现流程图;FIG. 1 is a flowchart of a method for automatically alarming a database in Embodiment 1 of the present application;
图2是本申请实施例二中数据库自动告警的方法的实现流程图;2 is a flowchart of a method for automatically alarming a database in a second embodiment of the present application;
图3是本申请实施例三中数据库自动告警的方法的实现流程图;3 is a flowchart of a method for automatically alarming a database in a third embodiment of the present application;
图4是本申请实施例四中数据库自动告警的方法的实现流程图;4 is a flowchart of a method for automatically alarming a database in a fourth embodiment of the present application;
图5是本申请实施例五中数据库自动告警的方法的实现流程图;5 is a flowchart of a method for automatically alarming a database in a fifth embodiment of the present application;
图6是本申请实施例六中数据库自动告警的装置的结构框图;6 is a structural block diagram of a database automatic alarm device in Embodiment 6 of the present application;
图7是本申请实施例七中终端设备的示意图。FIG. 7 is a schematic diagram of a terminal device in Embodiment 7 of the present application.
本发明的实施方式Embodiments of the invention
为了对本申请的技术特征、目的和效果有更加清楚的理解,现对照附图详细说明本申请的具体实施方式。In order to have a clearer understanding of the technical features, objects, and effects of the present application, specific implementations of the present application will now be described in detail with reference to the drawings.
请参阅图1,图1是本申请实施例提供的一种数据库自动告警的方法的实现流程图。如图1所示,该方法包括以下步骤:Please refer to FIG. 1. FIG. 1 is a flowchart of a method for automatically alarming a database provided by an embodiment of the present application. As shown in Figure 1, the method includes the following steps:
S101:获取与待设置告警的目标数据库相关的配置信息,所述配置信息包括目标数据库的标识信息和与所述目标数据库对应的告警目标。S101: Acquire configuration information related to a target database to which an alarm is to be set, where the configuration information includes identification information of the target database and an alarm target corresponding to the target database.
在本申请实施例中,首先获取与目标数据库相关的配置信息,配置信息包括目标数据库的标识信息和与目标数据库对应的告警目标,其中,目标数据库是指待设置告警的数据库,目标数据库可为一个或多个;标识信息是指目标数据库相关的用于标识该目标数据库的信息,比如目标数据库的名称或地址等;告警目标是指待告警的对象,格式可以为目标邮箱账号或目标手机号码等。值得一提的是,可以预先指定一个存储地址,并周期性地从该存储地址获取配置信息。In the embodiment of the present application, first, configuration information related to the target database is obtained. The configuration information includes identification information of the target database and an alarm target corresponding to the target database. The target database refers to a database to be set for an alarm. The target database may be One or more; identification information refers to the information related to the target database used to identify the target database, such as the name or address of the target database; alert target refers to the object to be alerted, the format can be the target email account number or the target mobile phone number Wait. It is worth mentioning that a storage address can be specified in advance and configuration information can be obtained periodically from the storage address.
S102:根据所述配置信息构建配置管理数据库CMDB,其中,所述CMDB对应有配置项,所述配置项中存入有所述标识信息,所述配置项对应的配置属性中存入有所述告警目标。S102: Construct a configuration management database CMDB according to the configuration information, wherein the CMDB corresponds to a configuration item, the identification information is stored in the configuration item, and the configuration attribute corresponding to the configuration item stores the Alarm target.
在获取到配置信息后,基于配置信息构建配置管理数据库(Configuration Management Database,CMDB)。CMDB是信息技术基础架构库(Information Technology Infrastructure Library,ITIL)的核心,相较于传统的侧重于信息物理存储的数据库,如Oracle数据库等,CMDB更侧重于对已存储信息的管理,包括整合、记录以及更新等,适用于配置信息经常变更的场景,故可应用于本申请实施例中。将配置信息存储至CMDB的具体过程为,将配置信息中的标识信息存储至CMDB中的配置项,并将配置信息中的告警目标存储至CMDB中的与上述配置项对应的配置属性,CMDB中的配置项用于指示CMDB所要管理的资源,配置属性用于描述配置项。After obtaining the configuration information, a Configuration Management Database (CMDB) is constructed based on the configuration information. CMDB is the core of the Information Technology Infrastructure Library (ITIL). Compared to traditional databases that focus on the physical storage of information, such as Oracle databases, CMDB focuses more on the management of stored information, including integration, Recording and updating are applicable to scenarios where configuration information is frequently changed, so they can be applied to the embodiments of this application. The specific process of storing the configuration information in the CMDB is to store the identification information in the configuration information to the configuration item in the CMDB, and store the alarm target in the configuration information to the configuration attribute corresponding to the above configuration item in the CMDB, in the CMDB The configuration items are used to indicate the resources to be managed by the CMDB, and the configuration attributes are used to describe the configuration items.
可选地,通过预设的信息系统获取配置信息。在本申请实施例中,可预先将CMDB与预设的信息系统进行连接,将配置信息录入至信息系统中,并在信息系统中提前设置在每隔固定的时间间隔或配置信息更新时,将配置信息发送至CMDB的机制,以实现CMDB对配置信息的自动获取。另外,可通过SaltStack工具实现CMDB与信息系统之间的通信。Optionally, the configuration information is obtained through a preset information system. In the embodiment of the present application, the CMDB can be connected to a preset information system in advance, and the configuration information can be entered into the information system, and the information system can be set in advance at regular intervals or when the configuration information is updated. The mechanism for sending configuration information to the CMDB to achieve automatic acquisition of configuration information by the CMDB. In addition, the communication between the CMDB and the information system can be achieved through the SaltStack tool.
S103:获取所述目标数据库的当前参数,所述当前参数包括所述目标数据库的特征信息、每秒操作次数以及当前流量,所述特征信息包括所述目标数据库的名称。S103: Acquire current parameters of the target database, where the current parameters include characteristic information of the target database, operations per second, and current traffic, and the characteristic information includes a name of the target database.
CMDB构建完成后,获取目标数据库的包括特征信息、每秒操作次数(Operation Per Second,OPS)以及当前流量的当前参数,获取当前参数可通过对目标数据库进行监控实现,其中,特征信息与标识信息的格式一致,即若标识信息的格式为名称,则特征信息的格式也为名称;每秒操作次数是指每秒对目标数据库进行增加、删除、更改以及查询操作的次数;当前流量是指目标数据库每秒输入和输出的数据的流量。以目标数据库为Oracle数据库举例,则可通过分别设定与特征信息、每秒操作次数以及当前流量相关的结构化查询语言(Structured Query Language,SQL)语句来实现监控。当然,根据实际应用场景,当前参数可不限于上述的特征信息、每秒操作次数以及当前流量,比如还可包括数据库连接数(数据库当前的所有线程数)和表空间占用率等。可选地,通过预设的监控系统监控目标数据库。在本申请实施例中,可在监控系统中完成对目标数据库的监控操作,监控系统可以是管理目标数据库所在主机的系统,并增设了与监控操作相关的SQL语句,通过设置单独的监控系统监控目标数据库,实现了各个系统的功能隔离,提升了监控的容错性。After the CMDB is constructed, the target database includes feature information, Operation Per Second (OPS), and current parameters of the current traffic. The current parameters can be obtained by monitoring the target database. Among them, the feature information and identification information The format is the same, that is, if the format of the identification information is a name, the format of the characteristic information is also a name; the number of operations per second refers to the number of additions, deletions, changes, and query operations to the target database per second; the current traffic refers to the target The flow of data input and output by the database per second. Taking the target database as an example of the Oracle database, a structured query language (Structured Query) related to feature information, operations per second, and current traffic can be set separately. Language (SQL) statements to implement monitoring. Of course, according to the actual application scenario, the current parameters may not be limited to the above-mentioned characteristic information, the number of operations per second, and the current traffic, such as the number of database connections (the current number of all threads in the database) and the table space occupation rate. Optionally, the target database is monitored by a preset monitoring system. In the embodiment of the present application, the monitoring operation of the target database may be completed in a monitoring system. The monitoring system may be a system that manages the host where the target database is located, and an SQL statement related to the monitoring operation is added. The monitoring is performed by setting a separate monitoring system. The target database realizes the functional isolation of each system and improves the fault tolerance of monitoring.
S104:当所述当前参数符合预设条件时,生成包含所述当前参数的告警信息。S104: When the current parameter meets a preset condition, generating alarm information including the current parameter.
在获取到当前参数后,判断当前参数是否符合预设条件,预设条件可以为预设的每秒操作次数的阈值和当前流量的阈值。若当前参数符合预设条件,即当前参数中的每秒操作次数和当前流量均大于或等于对应的阈值时,生成告警信息,告警信息通常为文本格式。值得一提的是,告警信息在包括当前参数的基础上,还可包括生成告警信息的时间和监控目标数据库的监控系统的相关信息等。After obtaining the current parameters, it is determined whether the current parameters meet a preset condition, and the preset condition may be a preset threshold of the number of operations per second and a threshold of the current traffic. If the current parameters meet the preset conditions, that is, the number of operations per second and the current traffic in the current parameters are greater than or equal to the corresponding threshold, an alarm message is generated, and the alarm message is usually in text format. It is worth mentioning that, based on the current parameters, the alarm information can also include the time when the alarm information was generated and the related information of the monitoring system monitoring the target database.
S105:通过执行预设的脚本文件查找所述CMDB中与所述告警信息中的所述特征信息相符的标识信息所对应的配置项,并从查找出的配置项的配置属性中获取对应的告警目标,将所述告警信息发送至获取到的告警目标。S105: Find a configuration item corresponding to the identification information in the CMDB that matches the characteristic information in the alarm information by executing a preset script file, and obtain a corresponding alarm from the configuration attribute of the found configuration item. A target, and sending the alarm information to the obtained alarm target.
在本申请实施例,通过执行预设的脚本文件实现告警信息的发送,具体地,在脚本文件的执行过程中,根据告警信息的特征信息,查找CMDB中是否存在配置项,该配置项的标识信息与特征信息相同,如果存在,则从该配置项对应的配置属性中获取告警目标,并自动将告警信息发送至告警目标。在脚本文件中可预设多种发送方式,从而在执行脚本文件时,自动根据告警目标的类型来采用对应的发送方式。举例来说,若告警目标为目标邮箱账号,则对应的一种发送方式是根据预设的任一个能够正常通信的邮箱帐号以及密码(可以为执行脚本文件的主机的邮箱账号及密码),将告警信息添加至该邮箱帐号的待发送邮件中,自动将待发送邮件发送至目标邮箱帐号。此外,在脚本文件中的发送告警信息的代码之前,还可设置判断机制,判断机制用于判断是否成功获取到告警目标,如果获取成功,则在脚本文件的执行过程中发送告警信息;如果获取失败,则输出包含告警信息的失败提示。优选地,脚本文件采用python语言进行编写。由于python语言的易用性和可扩展性强,故可应用在本实施例中。In the embodiment of the present application, the transmission of alarm information is implemented by executing a preset script file. Specifically, during the execution of the script file, according to the characteristic information of the alarm information, it is found whether there is a configuration item in the CMDB and the identifier of the configuration item. The information is the same as the characteristic information. If it exists, the alarm target is obtained from the configuration attribute corresponding to the configuration item, and the alarm information is automatically sent to the alarm target. Multiple sending methods can be preset in the script file, so when the script file is executed, the corresponding sending method is automatically adopted according to the type of the alarm target. For example, if the target of the alert is the target email account, a corresponding sending method is based on any preset email account and password (which can be the email account and password of the host executing the script file) that can communicate normally. The alarm information is added to the email to be sent to this email account, and the email to be sent is automatically sent to the target email account. In addition, before the code for sending the alarm information in the script file, a judgment mechanism can be set. The judgment mechanism is used to determine whether the alarm target was successfully obtained. If the acquisition is successful, the alarm information is sent during the execution of the script file. If it fails, a failure prompt containing alarm information is output. Preferably, the script file is written in python language. Since the python language is easy to use and extensible, it can be applied in this embodiment.
通过图1所示实施例可知,本申请实施例通过构建CMDB实现了数据库的自动告警,提升了数据库告警机制的配置效率,并且如果欲对告警目标进行更改,直接更改CMDB中的配置即可,提升了更改告警目标的便利性。According to the embodiment shown in FIG. 1, the embodiment of the present application realizes automatic alarming of the database by constructing a CMDB, which improves the configuration efficiency of the database alarm mechanism, and if the target of the alarm is to be changed, the configuration in the CMDB can be directly changed. Improved the convenience of changing alert targets.
请参阅图2,图2是本申请实施例二提供的一种数据库自动告警的方法的实现流程图。相对于图1对应的实施例,本实施例在配置信息包括标识信息和多个告警信息组,每个告警信息组包括告警目标和与告警目标对应的告警阈值的基础上,对S102进行细化后得到S201~S203,详述如下:Please refer to FIG. 2, which is a flowchart of implementing a database automatic alarm method provided in Embodiment 2 of the present application. Compared with the embodiment corresponding to FIG. 1, this embodiment refines S102 on the basis that the configuration information includes identification information and multiple alarm information groups, and each alarm information group includes an alarm target and an alarm threshold corresponding to the alarm target. S201 ~ S203 are obtained later, as follows:
S201:根据所述配置信息构建所述CMDB,其中,所述配置项中存入有所述标识信息,所述配置项对应有多个所述配置属性,每个所述配置属性中存入有一个所述告警信息组。S201: Construct the CMDB according to the configuration information, wherein the identification information is stored in the configuration item, the configuration item corresponds to a plurality of the configuration attributes, and each of the configuration attributes is stored in One said alarm information group.
在本申请实施例中,获取的配置信息包括目标数据库的标识信息及与目标数据库对应的多个告警信息组,其中每个告警信息组包括告警目标和与告警目标对应的告警阈值,则基于配置信息构建CMDB中的具体过程为,将配置信息中的标识信息存储至CMDB中的配置项,将配置信息中的多个告警信息组存储至CMDB中的与该配置项对应的多个配置属性中,其中每个配置属性存放一个告警信息组。In the embodiment of the present application, the obtained configuration information includes identification information of the target database and a plurality of alarm information groups corresponding to the target database, where each alarm information group includes an alarm target and an alarm threshold corresponding to the alarm target. The specific process in the information construction CMDB is to store the identification information in the configuration information to the configuration item in the CMDB, and store multiple alarm information groups in the configuration information to the multiple configuration attributes corresponding to the configuration item in the CMDB. , Where each configuration property stores an alarm information group.
S202:对所述告警信息进行分析,得到所述告警信息的告警值,所述告警值指示所述告警信息的严重程度。S202: Analyze the alarm information to obtain an alarm value of the alarm information, where the alarm value indicates the severity of the alarm information.
在配置信息包括标识信息及多个告警信息组时,预设的脚本文件与本申请实施例一的脚本文件存在不同,在本申请实施例的脚本文件的执行过程中,若已获取到告警信息,则查找CMDB中的与告警信息中的特征信息相同的标识信息所对应的配置项,并对告警信息进行分析得到告警信息的告警值。对告警信息进行分析的一种分析方法是获取预设的与每秒操作次数对应的多个次数区间及与当前流量对应的多个流量区间,每个次数区间和每个流量区间都包括区间值,通过判断告警信息中的每秒操作次数所属的次数区间和告警信息中的当前流量所属的流量区间,并将所属的次数区间的区间值和所属的流量区间的区间值相加得到告警值。When the configuration information includes identification information and multiple alarm information groups, the preset script file is different from the script file in the first embodiment of the present application. During the execution of the script file in the embodiment of the present application, if the alarm information has been obtained , Find the configuration item corresponding to the identification information in the CMDB that is the same as the characteristic information in the alarm information, and analyze the alarm information to obtain the alarm value of the alarm information. An analysis method for analyzing alarm information is to obtain preset multiple times intervals corresponding to the number of operations per second and multiple traffic intervals corresponding to the current traffic. Each times interval and each traffic interval include interval values. The alarm value is obtained by judging the frequency interval to which the number of operations per second in the alarm information belongs and the flow interval to which the current traffic in the alarm information belongs, and adding the interval value of the number of times interval and the interval value of the flow interval to which the alarm value belongs.
举例来说,假设判断是否生成告警信息的预设条件是每秒操作次数为5次,当前流量为3KB,并且每秒操作次数对应的多个次数区间包括每秒操作次数为5次至10次的次数区间,区间值为0;每秒操作次数为11次至15次的次数区间,区间值为1;每秒操作次数为16次及16次以上的次数区间,区间值为2。当前流量对应的多个流量区间包括当前流量为3KB至5KB的流量区间,区间值为0;当前流量为6KB至9KB的流量区间,区间值为1;当前流量为10KB及10KB以上的流量区间,区间值为2。假设告警信息中的每秒操作次数为15次,当前流量为8KB,则告警值为1+1=2,告警值指示了告警信息的严重程度,告警值越高,则严重程度越高。For example, suppose that the preset conditions for determining whether to generate alarm information are 5 operations per second, the current traffic is 3KB, and the number of times corresponding to the number of operations per second includes 5 to 10 operations per second. The number of times, the interval value is 0; the number of operations per second is 11 to 15 times, the interval value is 1; the number of operations per second is 16 times or more, the interval value is 2. The multiple traffic ranges corresponding to the current traffic include the current traffic ranges from 3KB to 5KB, and the interval value is 0; the current traffic ranges from 6KB to 9KB, and the interval value is 1; the current traffic ranges from 10KB and above 10KB, The interval value is 2. Assuming that the number of operations per second in the alarm information is 15 and the current traffic is 8KB, the alarm value is 1 + 1 = 2. The alarm value indicates the severity of the alarm information. The higher the alarm value, the higher the severity.
可选地,根据不同目标数据库的不同特征信息设置不同的多个次数区间和多个流量区间。比如特征信息为 Info feature-1 对应的多个次数区间为 Interval Times1-1 Interval Times1-2 Interval Times1-3 ,对应的多个流量区间为 Interval Data1-1 Interval Data1-2 Interval Data1-3 ;特征信息为 Info feature-2 对应的多个次数区间为 Interval Times2-1 Interval Times2-2 Interval Times2-3 ,对应的多个流量区间为 Interval Data2-1 Interval Data2-2 Interval Data2-3 。若获取到的告警信息的特征信息为 Info feature-2 ,则通过对应的多个次数区间 Interval Times2-1 Interval Times2-2 Interval Times2-3 和对应的多个流量区间 Interval Data2-1 Interval Data2-2 Interval Data2-3 对告警信息进行分析得到告警值,实现了不同目标数据库的告警信息的差异分析。 Optionally, different multiple times intervals and multiple traffic intervals are set according to different feature information of different target databases. Wherein such information Info feature-1 corresponding to the plurality of frequency interval Interval Times1-1, Interval Times1-2 and Interval Times1-3, traffic interval corresponding to the plurality of Interval Data1-1, Interval Data1-2 and Interval Data1- 3 ; The feature information is multiple times intervals corresponding to Info feature-2 are Interval Times2-1 , Interval Times2-2, and Interval Times2-3 , and the corresponding multiple traffic intervals are Interval Data2-1 , Interval Data2-2, and Interval Data2 -3 . If the feature information of the obtained alarm information is Info feature-2 , the corresponding multiple times intervals Interval Times2-1 , Interval Times2-2 and Interval Times2-3 and the corresponding multiple traffic intervals Interval Data2-1 and Interval are passed . Data2-2 and Interval Data2-3 analyze the alarm information to obtain the alarm value, and realize the difference analysis of the alarm information of different target databases.
S203:遍历查找出的所述配置项对应的多个所述配置属性中的所述告警信息组,将小于或等于所述告警值的所述告警阈值所对应的所述告警信息组中的所述告警目标添加至目标集,并将所述告警信息发送至所述目标集中的所述告警目标。S203: Traversing the alarm information group in the multiple configuration attributes corresponding to the found configuration item, traverses all alarm information groups in the alarm information group corresponding to the alarm threshold that is less than or equal to the alarm value. The alarm target is added to the target set, and the alarm information is sent to the alarm target in the target set.
计算得到告警信息的告警值后,遍历与查找出的配置项对应的多个配置属性,并将每个配置属性中告警信息组的告警阈值与告警值进行比较,如果告警阈值小于或等于告警值,则将告警阈值所属的告警信息组中的告警目标添加至目标集;如果告警阈值大于告警值,则继续将告警值与CMDB中下一个配置属性中告警信息组的告警阈值进行比较。当与配置项对应的多个配置属性遍历完成后,完成目标集的搭建,将告警信息发送至目标集中的所有告警目标。After calculating the alarm value of the alarm information, traverse multiple configuration attributes corresponding to the found configuration item, and compare the alarm threshold of the alarm information group in each configuration attribute with the alarm value. If the alarm threshold is less than or equal to the alarm value , The alarm target in the alarm information group to which the alarm threshold belongs is added to the target set; if the alarm threshold is greater than the alarm value, the alarm value is continuously compared with the alarm threshold of the alarm information group in the next configuration attribute in the CMDB. After the traversal of multiple configuration attributes corresponding to the configuration items is completed, the target set is completed, and the alarm information is sent to all alarm targets in the target set.
通过图2所示实施例可知,本申请实施例通过在CMDB存储多个告警目标,实现了对不同严重程度的告警信息的区别告警,提升了告警的适用性。It can be known from the embodiment shown in FIG. 2 that in the embodiment of the present application, by storing multiple alarm targets in the CMDB, different alarms of alarm information of different severity levels are realized, and the applicability of the alarm is improved.
请参阅图3,图3是本申请实施例三提供的一种数据库自动告警的方法的实现流程图。相对于图2对应的实施例,本实施例在配置信息还包括与当前参数对应的多个权值的基础上,对S201进行细化后得到S301~S302,详述如下:Please refer to FIG. 3, which is a flowchart of implementing a method for automatically alarming a database provided in Embodiment 3 of the present application. Compared with the embodiment corresponding to FIG. 2, this embodiment further refines S201 to obtain S301 to S302 on the basis that the configuration information further includes multiple weights corresponding to the current parameters, as follows:
S301:根据所述配置信息构建所述CMDB,其中,所述配置项中存入有所述标识信息,所述配置项对应有多个所述配置属性,每个所述配置属性中存入有一个所述告警信息组以及所述多个权值。S301: Construct the CMDB according to the configuration information, wherein the identification information is stored in the configuration item, the configuration item corresponds to a plurality of the configuration attributes, and each of the configuration attributes is stored in One alarm information group and the plurality of weights.
在实际应用场景中,当前参数中包括的多个内容,如每秒操作次数和当前流量的重要程度可能存在不同,故可预先设置配置信息中还包括与当前参数对应的多个权值,并在基于配置信息构建CMDB时,将配置信息中的标识信息存储至CMDB的配置项,将配置信息中的多个告警信息组分别存储至与配置项对应的多个配置属性,其中每个配置属性中存入有一个告警信息组,并将配置信息中的多个权值存储至与配置项对应的每个配置属性,存储完毕后,每个配置属性中都存放有多个权值。In an actual application scenario, multiple contents included in the current parameters, such as the number of operations per second and the importance of the current traffic may be different. Therefore, the configuration information may be preset to include multiple weights corresponding to the current parameters, and When the CMDB is constructed based on the configuration information, the identification information in the configuration information is stored in the configuration items of the CMDB, and multiple alarm information groups in the configuration information are respectively stored in multiple configuration attributes corresponding to the configuration items, where each configuration attribute An alarm information group is stored in the alarm information group, and multiple weights in the configuration information are stored in each configuration attribute corresponding to the configuration item. After the storage is completed, multiple weights are stored in each configuration attribute.
在S302中,查找所述CMDB中的与所述告警信息中的所述特征信息相符的所述标识信息所对应的所述配置项,并获取与查找出的所述配置项对应的任意一个所述配置属性中的所述多个权值,基于所述多个权值对所述告警信息进行加权求和,得到所述告警值。In S302, the configuration item corresponding to the identification information in the CMDB that matches the characteristic information in the alarm information is searched, and any one of the configuration items corresponding to the found configuration item is obtained. The plurality of weights in the configuration attribute are obtained by weighting and adding the alarm information based on the plurality of weights to obtain the alarm value.
将多个权值存储至CMDB中的多个配置属性后,并在告警信息已生成,对告警信息进行分析时,查找CMDB中的配置项,该配置项的标识信息与告警信息中的特征信息相符。获取与该查找出的配置项对应的任意一个配置属性中的多个权值,并基于多个权值对告警信息进行加权求和,具体地,可根据步骤S202中的分析方法,先判断告警信息中的每秒操作次数所属次数区间的区间值和告警信息中的当前流量所属流量区间的区间值,再根据每秒操作次数对应的权值和当前流量对应的权值对区间值进行加权求和,将得到的结果作为告警值。举例来说,告警信息中的每秒操作次数所属次数区间的区间值为 Value Interval-1 ,告警信息中的当前流量所属流量区间的区间值为 Value Interval-2 ,CMDB存储的与每秒操作次数对应的权值为 Weight Times ,与当前流量对应的权值为 Weight Data ,则告警值 Value warn 的计算方法为 Value warn = Value Interval-1 · Weight Times + Value Interval-2 · Weight Data After storing multiple weights to multiple configuration attributes in the CMDB, and after the alarm information is generated, analyze the alarm information to find the configuration item in the CMDB, the identification information of the configuration item and the characteristic information in the alarm information Match. Obtain multiple weights in any one of the configuration attributes corresponding to the found configuration item, and perform weighted summation of the alarm information based on the multiple weights. Specifically, the alarm may be determined first according to the analysis method in step S202. The interval value of the interval of the number of operations per second in the information and the interval value of the current interval of the current traffic in the alarm information, and then the interval value is weighted according to the weight corresponding to the number of operations per second and the weight corresponding to the current traffic. And, the obtained result is used as the alarm value. For example, the interval of the number of operations per second in the alarm information is Value Interval-1 , and the interval of the current interval in the alarm information is Value Interval-2 . The CMDB stores the number of operations per second. The corresponding weight value is Weight Times and the weight value corresponding to the current traffic is Weight Data . The calculation method of the value warn is Value warn = Value Interval-1 · Weight Times + Value Interval-2 · Weight Data .
通过图3所示实施例可知,本申请实施例通过将与当前参数中不同内容对应的多个权值存入CMDB,并在对告警信息分析时取出权值并进行加权求和,实现了对不同内容的重要程度区分,提升了告警值生成的准确性。It can be known from the embodiment shown in FIG. 3 that in the embodiment of the present application, multiple weights corresponding to different contents in the current parameters are stored in the CMDB, and the weights are taken out and weighted and summed during the analysis of the alarm information. The importance of different content is distinguished, which improves the accuracy of generating alarm values.
请参阅图4,图4是本申请实施例四提供的一种数据库自动告警的方法的实现流程图。相对于图1对应的实施例,本实施例对S103进行细化后得到S401~S403,详述如下:Please refer to FIG. 4, which is a flowchart of implementing a database automatic alarm method provided in Embodiment 4 of the present application. Compared with the embodiment corresponding to FIG. 1, this embodiment refines S103 to obtain S401 to S403, which are detailed as follows:
S401:在所述目标数据库的主机搭建zabbix客户端。S401: Set up a zabbix client on the host of the target database.
在本申请实施例中,通过zabbix实现对目标数据库的监控,其中,zabbix是一款开源的分布式监控系统,适用于存在一个或多个目标数据库的场景。zabbix主要包括zabbix服务端和zabbix客户端,zabbix服务端是zabbix的核心组件,负责接收zabbix客户端发送的数据;zabbix客户端部署在被监控的主机上,用于采集该主机的数据。在本申请实施例中,在需要查看当前参数的主机(用户操作的主机)上建立zabbix服务端,并在目标数据库所在的主机上建立zabbix客户端,建立过程可通过安装zabbix安装包实现。In the embodiment of the present application, the monitoring of the target database is implemented by zabbix. Among them, zabbix is an open source distributed monitoring system, which is applicable to the scenario where one or more target databases exist. Zabbix mainly includes a zabbix server and a zabbix client. The zabbix server is a core component of zabbix and is responsible for receiving data sent by the zabbix client. The zabbix client is deployed on the monitored host and is used to collect data from the host. In the embodiment of the present application, a zabbix server is established on a host (a host operated by a user) that needs to view current parameters, and a zabbix client is established on the host where the target database is located. The establishment process can be implemented by installing a zabbix installation package.
S402:创建zabbix监控项,所述zabbix监控项的监控目标为所述zabbix客户端中的所述目标数据库。S402: Create a zabbix monitoring item, and the monitoring target of the zabbix monitoring item is the target database in the zabbix client.
要对zabbix客户端中的目标数据库进行监控,首先编写监控脚本,监控脚本中包括用于检测当前参数的Shell语句。编写完成后,将监控脚本添加至zabbix客户端的配置文件(名称一般为zabbix_agentd.conf)中,作为一个自定义的键(key),并重启zabbix客户端。在zabbix中,键与监控项通常是配套的,即如果想要获取监控项对应的数据,则必须通过键去获取。故在成功生成自定义的获取当前参数的键后,在zabbix服务端建立包含该键的监控项,通过运行该监控项,zabbix服务端可获取到目标数据库的当前参数。值得一提的是,还可设置监控项的运行时间或运行间隔,以满足当前参数的获取需求,比如每天早上八点运行一次监控项或每隔半个小时运行一次监控项。To monitor the target database in the zabbix client, first write a monitoring script. The monitoring script includes a shell statement for detecting the current parameters. After writing, add the monitoring script to the zabbix client configuration file (usually named zabbix_agentd.conf) as a custom key and restart the zabbix client. In Zabbix, keys and monitoring items are usually matched, that is, if you want to obtain the data corresponding to the monitoring item, you must use the key to get. Therefore, after successfully generating a custom key for obtaining the current parameters, a monitoring item containing the key is established on the zabbix server. By running the monitoring item, the zabbix server can obtain the current parameters of the target database. It is worth mentioning that the running time or running interval of the monitoring items can also be set to meet the acquisition requirements of the current parameters, such as running the monitoring item at 8 o'clock every morning or running the monitoring item every half an hour.
S403:对所述zabbix监控项赋予一次执行权限,当通过执行所述zabbix监控项得到的数据与所述当前参数的格式符合时,对所述zabbix监控项赋予自动执行的执行权限。S403: Give the Zabbix monitoring item an execution permission once. When the data obtained by executing the Zabbix monitoring item matches the format of the current parameter, give the Zabbix monitoring item an automatic execution execution permission.
在本申请实施例中,对zabbix监控项赋予一次执行权限,即当zabbix服务端检测到通过zabbix监控项获取到数据时,停止对zabbix监控项执行权限的赋予。将通过zabbix监控项获取到的数据的格式与当前参数的格式进行比对,若通过zabbix监控项获取到的数据的格式与当前参数的格式相同,则认定zabbix监控项获取到的数据无误,zabbix服务端对zabbix监控项赋予自动执行的执行权限,zabbix监控项按照设定的运行时间或运行间隔自动运行。In the embodiment of the present application, the execution permission is given to the zabbix monitoring item once, that is, when the zabbix server detects that data is obtained through the zabbix monitoring item, it stops giving the execution permission to the zabbix monitoring item. The format of the data obtained through the zabbix monitoring item is compared with the format of the current parameter. If the format of the data obtained through the zabbix monitoring item is the same as the format of the current parameter, the data obtained by the zabbix monitoring item is deemed to be correct, zabbix The server gives the Zabbix monitoring item the execution permission for automatic execution, and the Zabbix monitoring item runs automatically according to the set running time or running interval.
通过图4所示实施例可知,本申请实施例通过zabbix技术实现目标数据库的当前参数的获取,由于zabbix的分布式特性,故适用于存在多个目标数据库的场景,提升了当前参数获取的适用性。According to the embodiment shown in FIG. 4, the embodiment of the present application uses zabbix technology to obtain the current parameters of the target database. Due to the distributed nature of zabbix, it is applicable to scenarios where multiple target databases exist, which improves the applicability of current parameter acquisition Sex.
请参阅图5,图5是本申请实施例五提供的一种数据库自动告警的方法的实现流程图。相对于图1对应的实施例,本实施例在预设条件包括多个告警等级的基础上,对S104进行细化后得到S501~S502,详述如下:Please refer to FIG. 5, which is a flowchart of a method for automatically alarming a database provided in Embodiment 5 of the present application. Compared with the embodiment corresponding to FIG. 1, this embodiment refines S104 to obtain S501 to S502 on the basis of preset conditions including multiple alarm levels, as follows:
S501:从所述多个告警等级中确定所述当前参数符合的所述告警等级。S501: Determine the alarm level that the current parameter complies with from the multiple alarm levels.
在本申请实施例中,预设条件包括多个告警等级,告警等级指示当前参数的严重程度,比如可为安全、轻微、严重以及危急等。另外,设置与多个告警等级一一对应的多个告警区间,通过判断当前参数所属的告警区间来确定告警等级,其中,与步骤S202中的次数区间和流量区间不同,每一个告警区间包括每秒操作次数的取值范围和当前流量的取值范围。举例来说,告警等级为轻微,对应的告警区间为:每秒操作次数为2到4次,当前流量为2KB到4KB;告警等级为严重,对应的告警区间为:每秒操作次数为5到6次,当前流量为5KB到6KB。如果当前参数中每秒操作次数为3次,当前流量为3KB,则当前参数符合的告警等级为轻微。值得一提的是,若无法确定与当前参数对应的告警等级,则输出报警提示。In the embodiment of the present application, the preset condition includes multiple alarm levels, and the alarm levels indicate the severity of the current parameters, such as safety, minor, severe, and critical. In addition, multiple alarm intervals corresponding to multiple alarm levels are set, and the alarm level is determined by judging the alarm interval to which the current parameter belongs. Among them, different from the frequency interval and the flow interval in step S202, each alarm interval includes each The value range of the number of operations in seconds and the value range of the current traffic. For example, the alarm level is mild, and the corresponding alarm interval is: 2 to 4 operations per second, and the current traffic is 2KB to 4KB; the alarm level is severe, and the corresponding alarm interval is: 5 to 5 operations per second. Six times, the current traffic is 5KB to 6KB. If the number of operations per second in the current parameter is 3 and the current traffic is 3KB, the alarm level that the current parameter meets is minor. It is worth mentioning that if the alarm level corresponding to the current parameter cannot be determined, an alarm prompt is output.
S502:将所述当前参数符合的所述告警等级和所述当前参数添加至预设的告警信息模板,生成所述告警信息。S502: Add the alarm level and the current parameter that the current parameters meet to a preset alarm information template to generate the alarm information.
在确定当前参数符合的告警等级后,将该告警等级与当前参数添加至预设的告警信息模板,生成告警信息,比如告警信息模板可为:After determining the alarm level that the current parameters meet, add the alarm level and current parameters to a preset alarm information template to generate alarm information. For example, the alarm information template can be:
特征信息:A    每秒操作次数:B    当前流量:CCharacteristic information: A operations per second: B Current traffic: C
告警等级:DAlarm level: D
上述的A、B、C和D指示未知的参数,将告警等级和当前参数添加至告警信息模板,即是将告警等级和当前参数替代告警信息模板中对应的A、B、C和D,从而生成告警信息。The above A, B, C, and D indicate unknown parameters. Adding the alarm level and current parameters to the alarm information template is to replace the alarm levels and current parameters with the corresponding A, B, C, and D in the alarm information template. Generate alarm information.
通过图5所示实施例可知,在本申请实施例中,预设条件包括多个告警等级,在当前参数符合预设条件时,生成告警信息信息的过程具体为从多个告警等级中确定当前参数符合的告警等级,将当前参数符合的告警等级和当前参数添加至预设的告警信息模板,生成告警信息,提升了告警信息的可辨识度。It can be known from the embodiment shown in FIG. 5 that in the embodiment of the present application, the preset condition includes multiple alarm levels. When the current parameters meet the preset conditions, the process of generating alarm information is specifically determining the current alarm level from multiple alarm levels. The alarm level that the parameters meet, adds the current alarm level and the current parameters to the preset alarm information template, generates alarm information, and improves the recognizability of the alarm information.
对应于上文实施例所述的一种数据库自动告警的方法,图6示出了本申请实施例提供的一种数据库自动告警的装置的一个结构框图,参照图6,该装置包括:Corresponding to the method of automatic database alarming described in the above embodiment, FIG. 6 shows a structural block diagram of a database automatic alarming device provided by an embodiment of the present application. Referring to FIG. 6, the device includes:
第一获取单元61,用于获取与待设置告警的目标数据库相关的配置信息,所述配置信息包括目标数据库的标识信息和与所述目标数据库对应的告警目标;The first obtaining unit 61 is configured to obtain configuration information related to a target database to which an alarm is to be set, where the configuration information includes identification information of the target database and an alarm target corresponding to the target database;
构建单元62,用于根据所述配置信息构建配置管理数据库CMDB,其中,所述CMDB对应有配置项,所述配置项中存入有所述标识信息,所述配置项对应的配置属性中存入有所述告警目标;A construction unit 62 is configured to construct a configuration management database CMDB according to the configuration information, wherein the CMDB corresponds to a configuration item, the configuration item stores the identification information, and the configuration attribute corresponding to the configuration item stores The alarm target is entered;
第二获取单元63,用于获取所述目标数据库的当前参数,所述当前参数包括所述目标数据库的特征信息、每秒操作次数以及当前流量,所述特征信息包括所述目标数据库的名称;A second obtaining unit 63, configured to obtain current parameters of the target database, where the current parameters include characteristic information of the target database, operations per second, and current traffic, and the characteristic information includes a name of the target database;
生成单元64,用于当所述当前参数符合预设条件时,生成包含所述当前参数的告警信息;A generating unit 64, configured to generate alarm information including the current parameter when the current parameter meets a preset condition;
执行单元65,用于通过执行预设的脚本文件查找所述CMDB中与所述告警信息中的所述特征信息相符的标识信息所对应的配置项,并从查找出的配置项的配置属性中获取对应的告警目标,将所述告警信息发送至获取到的告警目标。The execution unit 65 is configured to find, by executing a preset script file, a configuration item corresponding to the identification information in the CMDB that matches the characteristic information in the alarm information, and from the configuration attributes of the found configuration item, Acquire a corresponding alarm target, and send the alarm information to the acquired alarm target.
可选地,所述配置信息包括所述标识信息和多个告警信息组,每个所述告警信息组包括所述告警目标和与所述告警目标对应的告警阈值,所述构建单元62,包括:Optionally, the configuration information includes the identification information and multiple alarm information groups, and each of the alarm information groups includes the alarm target and an alarm threshold corresponding to the alarm target, and the constructing unit 62 includes :
第一构建子单元,用于根据所述配置信息构建所述CMDB,其中,所述配置项中存入有所述标识信息,所述配置项对应有多个所述配置属性,每个所述配置属性中存入有一个所述告警信息组;A first constructing subunit configured to construct the CMDB according to the configuration information, wherein the configuration item stores the identification information, and the configuration item corresponds to a plurality of the configuration attributes, each of which One configuration of the alarm information group is stored in the configuration attribute;
所述执行单元65,包括:The execution unit 65 includes:
分析单元,用于对所述告警信息进行分析,得到所述告警信息的告警值,所述告警值指示所述告警信息的严重程度;An analysis unit, configured to analyze the alarm information to obtain an alarm value of the alarm information, where the alarm value indicates a severity of the alarm information;
遍历单元,用于遍历查找出的所述配置项对应的多个所述配置属性中的所述告警信息组,将小于或等于所述告警值的所述告警阈值所对应的所述告警信息组中的所述告警目标添加至目标集,并将所述告警信息发送至所述目标集中的所述告警目标。The traversal unit is configured to traverse the alarm information group in the plurality of configuration attributes corresponding to the found configuration item, and the alarm information group corresponding to the alarm threshold value that is less than or equal to the alarm value The alarm target in is added to a target set, and the alarm information is sent to the alarm target in the target set.
可选地,所述配置信息还包括与所述当前参数对应的多个权值,所述构建单元62,包括:Optionally, the configuration information further includes multiple weights corresponding to the current parameters, and the constructing unit 62 includes:
第二构建子单元,用于根据所述配置信息构建所述CMDB,其中,所述配置项中存入有所述标识信息,所述配置项对应有多个所述配置属性,每个所述配置属性中存入有一个所述告警信息组以及所述多个权值;A second construction subunit is configured to construct the CMDB according to the configuration information, wherein the identification information is stored in the configuration item, and the configuration item corresponds to a plurality of the configuration attributes, each of which One configuration of the alarm information group and the plurality of weight values are stored in the configuration attributes;
所述分析单元,包括:The analysis unit includes:
查找单元,用于查找所述CMDB中的与所述告警信息中的所述特征信息相符的所述标识信息所对应的所述配置项,并获取与查找出的所述配置项对应的任意一个所述配置属性中的所述多个权值,基于所述多个权值对所述告警信息进行加权求和,得到所述告警值。A searching unit, configured to search the configuration item corresponding to the identification information in the CMDB that matches the characteristic information in the alarm information, and obtain any one corresponding to the found configuration item The plurality of weight values in the configuration attribute are obtained by weighting and adding the alarm information based on the plurality of weight values to obtain the alarm value.
可选地,所述第二获取单元63,包括:Optionally, the second obtaining unit 63 includes:
搭建单元,用于在所述目标数据库的主机搭建zabbix客户端;A building unit for building a zabbix client on the host of the target database;
创建单元,用于创建zabbix监控项,所述zabbix监控项的监控目标为所述zabbix客户端中的所述目标数据库;A creating unit, configured to create a zabbix monitoring item, and a monitoring target of the zabbix monitoring item is the target database in the zabbix client;
赋予单元,用于对所述zabbix监控项赋予一次执行权限,当通过执行所述zabbix监控项得到的数据与所述当前参数的格式符合时,对所述zabbix监控项赋予自动执行的执行权限。The assigning unit is configured to assign an execution permission to the Zabbix monitoring item once. When the data obtained by executing the Zabbix monitoring item matches the format of the current parameter, the Zabbix monitoring item is given an automatic execution execution permission.
可选地,所述预设条件包括多个告警等级,所述生成单元64,包括:Optionally, the preset condition includes multiple alarm levels, and the generating unit 64 includes:
等级确定单元,用于从所述多个告警等级中确定所述当前参数符合的所述告警等级;A level determining unit, configured to determine, from the multiple alarm levels, the alarm level that the current parameter complies with;
添加单元,用于将所述当前参数符合的所述告警等级和所述当前参数添加至预设的告警信息模板,生成所述告警信息。An adding unit is configured to add the alarm level and the current parameter that the current parameters meet to a preset alarm information template to generate the alarm information.
图7是本申请实施例提供的终端设备的示意图。如图7所示,该实施例的终端设备7包括:处理器70以及存储器71,所述存储器71中存储有可在所述处理器70上运行的计算机可读指令72,例如数据库自动告警的程序。所述处理器70执行所述计算机可读指令72时实现上述各个数据库自动告警的方法实施例中的步骤,例如图1所示的步骤S101至S105。或者,所述处理器70执行所述计算机可读指令72时实现上述装置实施例中各单元的功能,例如图6所示单元61至65的功能。FIG. 7 is a schematic diagram of a terminal device according to an embodiment of the present application. As shown in FIG. 7, the terminal device 7 of this embodiment includes a processor 70 and a memory 71. The memory 71 stores computer-readable instructions 72 that can be run on the processor 70, such as a database for automatic alarm. program. When the processor 70 executes the computer-readable instructions 72, the steps in the method embodiment for implementing the automatic alarm of each database described above, for example, steps S101 to S105 shown in FIG. Alternatively, when the processor 70 executes the computer-readable instructions 72, the functions of the units in the foregoing device embodiments are implemented, for example, the functions of the units 61 to 65 shown in FIG. 6.
示例性的,所述计算机可读指令72可以被分割成一个或多个模块/单元,所述一个或者多个模块/单元被存储在所述存储器71中,并由所述处理器70执行,以完成本申请。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机可读指令段,该指令段用于描述所述计算机可读指令72在所述终端设备7中的执行过程。例如,所述计算机可读指令72可以被分割成第一获取单元、构建单元、第二获取单元、生成单元以及执行单元,各单元具体功能如上所述。Exemplarily, the computer-readable instructions 72 may be divided into one or more modules / units, the one or more modules / units are stored in the memory 71 and executed by the processor 70, To complete this application. The one or more modules / units may be a series of computer-readable instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer-readable instructions 72 in the terminal device 7. For example, the computer-readable instructions 72 may be divided into a first acquisition unit, a construction unit, a second acquisition unit, a generation unit, and an execution unit, and the specific functions of each unit are as described above.
所述终端设备可包括,但不仅限于,处理器70、存储器71。本领域技术人员可以理解,图7仅仅是终端设备7的示例,并不构成对终端设备7的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述终端设备还可以包括输入输出设备、网络接入设备、总线等。The terminal device may include, but is not limited to, a processor 70 and a memory 71. Those skilled in the art can understand that FIG. 7 is only an example of the terminal device 7 and does not constitute a limitation on the terminal device 7. It may include more or fewer components than shown in the figure, or combine some components or different components. For example, the terminal device may further include an input / output device, a network access device, a bus, and the like.
所称处理器70可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器 (Digital Signal Processor,DSP)、专用集成电路 (Application Specific Integrated Circuit,ASIC)、现成可编程门阵列 (Field-Programmable Gate Array,FPGA) 或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The processor 70 may be a central processing unit (Central Processing Unit (CPU), or other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (Application Specific Integrated Circuits) Specific Integrated Circuit (ASIC), off-the-shelf Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
所述存储器71可以是所述终端设备7的内部存储单元,例如终端设备7的硬盘或内存。所述存储器71也可以是所述终端设备7的外部存储设备,例如所述终端设备7上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器71还可以既包括所述终端设备7的内部存储单元也包括外部存储设备。所述存储器71用于存储所述计算机可读指令以及所述终端设备所需的其他程序和数据。所述存储器71还可以用于暂时地存储已经输出或者将要输出的数据。The memory 71 may be an internal storage unit of the terminal device 7, such as a hard disk or a memory of the terminal device 7. The memory 71 may also be an external storage device of the terminal device 7, such as a plug-in hard disk, a smart memory card (SMC), and a secure digital (SD) provided on the terminal device 7. Card, flash card, etc. Further, the memory 71 may further include both an internal storage unit of the terminal device 7 and an external storage device. The memory 71 is configured to store the computer-readable instructions and other programs and data required by the terminal device. The memory 71 may also be used to temporarily store data that has been output or is to be output.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each of the units may exist separately physically, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially a part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium , Including a number of instructions to enable a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in the embodiments of the present application. The foregoing storage media include: U disks, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or compact discs, and other media that can store program codes .
以上所述,以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。As mentioned above, the above embodiments are only used to describe the technical solution of the present application, rather than limiting the present invention. Although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still interpret the foregoing. The technical solutions described in the embodiments are modified, or some technical features are equivalently replaced; and these modifications or replacements do not depart from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (20)

  1. 一种数据库自动告警的方法,其特征在于,包括:A method for automatically alerting a database, comprising:
    获取与待设置告警的目标数据库相关的配置信息,所述配置信息包括目标数据库的标识信息和与所述目标数据库对应的告警目标;Acquiring configuration information related to a target database to which an alarm is to be set, the configuration information including identification information of the target database and an alarm target corresponding to the target database;
    根据所述配置信息构建配置管理数据库CMDB,其中,所述CMDB对应有配置项,所述配置项中存入有所述标识信息,所述配置项对应的配置属性中存入有所述告警目标;Build a configuration management database CMDB according to the configuration information, wherein the CMDB corresponds to a configuration item, the identification information is stored in the configuration item, and the alarm target is stored in a configuration attribute corresponding to the configuration item ;
    获取所述目标数据库的当前参数,所述当前参数包括所述目标数据库的特征信息、每秒操作次数以及当前流量,所述特征信息包括所述目标数据库的名称;Acquiring current parameters of the target database, where the current parameters include characteristic information of the target database, operations per second, and current traffic, and the characteristic information includes a name of the target database;
    当所述当前参数符合预设条件时,生成包含所述当前参数的告警信息;When the current parameter meets a preset condition, generating alarm information including the current parameter;
    通过执行预设的脚本文件查找所述CMDB中与所述告警信息中的所述特征信息相符的标识信息所对应的配置项,并从查找出的配置项的配置属性中获取对应的告警目标,将所述告警信息发送至获取到的告警目标。Find a configuration item corresponding to the identification information in the CMDB that matches the characteristic information in the alarm information by executing a preset script file, and obtain a corresponding alarm target from the configuration attribute of the found configuration item, And sending the alarm information to the acquired alarm target.
  2. 如权利要求1所述的方法,其特征在于,所述配置信息包括所述标识信息和多个告警信息组,每个所述告警信息组包括所述告警目标和与所述告警目标对应的告警阈值,所述根据所述配置信息构建配置管理数据库CMDB,包括:The method according to claim 1, wherein the configuration information includes the identification information and a plurality of alarm information groups, and each of the alarm information groups includes the alarm target and an alarm corresponding to the alarm target A threshold, and the constructing a configuration management database CMDB according to the configuration information includes:
    根据所述配置信息构建所述CMDB,其中,所述配置项中存入有所述标识信息,所述配置项对应有多个所述配置属性,每个所述配置属性中存入有一个所述告警信息组;The CMDB is constructed according to the configuration information, wherein the identification information is stored in the configuration item, the configuration item corresponds to a plurality of the configuration attributes, and each of the configuration attributes stores one Said alarm information group;
    所述从查找出的配置项的配置属性中获取对应的告警目标,将所述告警信息发送至获取到的告警目标,包括:The acquiring the corresponding alarm target from the configuration attributes of the found configuration item, and sending the alarm information to the acquired alarm target includes:
    对所述告警信息进行分析,得到所述告警信息的告警值,所述告警值指示所述告警信息的严重程度;Analyzing the alarm information to obtain an alarm value of the alarm information, where the alarm value indicates the severity of the alarm information;
    遍历查找出的所述配置项对应的多个所述配置属性中的所述告警信息组,将小于或等于所述告警值的所述告警阈值所对应的所述告警信息组中的所述告警目标添加至目标集,并将所述告警信息发送至所述目标集中的所述告警目标。Traversing the alarm information group in the plurality of configuration attributes corresponding to the configuration item found will traverse the alarm in the alarm information group corresponding to the alarm threshold that is less than or equal to the alarm value A target is added to the target set, and the alarm information is sent to the alarm target in the target set.
  3. 如权利要求2所述的方法,其特征在于,所述配置信息还包括与所述当前参数对应的多个权值,所述根据所述配置信息构建所述CMDB,其中,所述配置项中存入有所述标识信息,所述配置项对应有多个所述配置属性,每个所述配置属性中存入有一个所述告警信息组,包括:The method according to claim 2, wherein the configuration information further comprises a plurality of weights corresponding to the current parameters, and the CMDB is constructed according to the configuration information, wherein, in the configuration item, The identification information is stored, and the configuration item corresponds to a plurality of the configuration attributes. Each of the configuration attributes stores one of the alarm information groups, including:
    根据所述配置信息构建所述CMDB,其中,所述配置项中存入有所述标识信息,所述配置项对应有多个所述配置属性,每个所述配置属性中存入有一个所述告警信息组以及所述多个权值;The CMDB is constructed according to the configuration information, wherein the identification information is stored in the configuration item, the configuration item corresponds to a plurality of the configuration attributes, and each of the configuration attributes stores one The alarm information group and the multiple weights;
    所述对所述告警信息进行分析,得到所述告警信息的告警值,包括:The analyzing the alarm information to obtain an alarm value of the alarm information includes:
    查找所述CMDB中的与所述告警信息中的所述特征信息相符的所述标识信息所对应的所述配置项,并获取与查找出的所述配置项对应的任意一个所述配置属性中的所述多个权值,基于所述多个权值对所述告警信息进行加权求和,得到所述告警值。Find the configuration item corresponding to the identification information in the CMDB that matches the characteristic information in the alarm information, and obtain any one of the configuration attributes corresponding to the found configuration item The weighted summation of the plurality of weight values based on the plurality of weight values to obtain the alarm value.
  4. 如权利要求1所述的方法,其特征在于,所述获取所述目标数据库的当前参数,包括:The method according to claim 1, wherein the acquiring the current parameters of the target database comprises:
    在所述目标数据库的主机搭建zabbix客户端;Building a zabbix client on the host of the target database;
    创建zabbix监控项,所述zabbix监控项的监控目标为所述zabbix客户端中的所述目标数据库;Create a zabbix monitoring item, and the monitoring target of the zabbix monitoring item is the target database in the zabbix client;
    对所述zabbix监控项赋予一次执行权限,当通过执行所述zabbix监控项得到的数据与所述当前参数的格式符合时,对所述zabbix监控项赋予自动执行的执行权限。The Zabbix monitoring item is given an execution permission once, and when the data obtained by executing the Zabbix monitoring item matches the format of the current parameter, the Zabbix monitoring item is given an automatic execution execution permission.
  5. 如权利要求1所述的方法,其特征在于,所述预设条件包括多个告警等级,所述当所述当前参数符合预设条件时,生成包含所述当前参数的告警信息,包括:The method according to claim 1, wherein the preset condition includes multiple alarm levels, and when the current parameter meets the preset condition, generating alarm information including the current parameter includes:
    从所述多个告警等级中确定所述当前参数符合的所述告警等级;Determining, from the plurality of alarm levels, the alarm level to which the current parameter complies;
    将所述当前参数符合的所述告警等级和所述当前参数添加至预设的告警信息模板,生成所述告警信息。Adding the alarm level and the current parameter that the current parameters meet to a preset alarm information template to generate the alarm information.
  6. 一种数据库自动告警的装置,其特征在于,包括:A device for automatically alarming a database, which is characterized by comprising:
    第一获取单元,用于获取与待设置告警的目标数据库相关的配置信息,所述配置信息包括目标数据库的标识信息和与所述目标数据库对应的告警目标;A first obtaining unit, configured to obtain configuration information related to a target database to which an alarm is to be set, where the configuration information includes identification information of the target database and an alarm target corresponding to the target database;
    构建单元,用于根据所述配置信息构建配置管理数据库CMDB,其中,所述CMDB对应有配置项,所述配置项中存入有所述标识信息,所述配置项对应的配置属性中存入有所述告警目标;A constructing unit is configured to construct a configuration management database CMDB according to the configuration information, wherein the CMDB corresponds to a configuration item, the identification information is stored in the configuration item, and the configuration attribute corresponding to the configuration item is stored in Have the alert target;
    第二获取单元,用于获取所述目标数据库的当前参数,所述当前参数包括所述目标数据库的特征信息、每秒操作次数以及当前流量,所述特征信息包括所述目标数据库的名称;A second obtaining unit, configured to obtain current parameters of the target database, where the current parameters include characteristic information of the target database, operations per second, and current traffic, and the characteristic information includes a name of the target database;
    生成单元,用于当所述当前参数符合预设条件时,生成包含所述当前参数的告警信息;A generating unit, configured to generate alarm information including the current parameter when the current parameter meets a preset condition;
    执行单元,用于通过执行预设的脚本文件查找所述CMDB中与所述告警信息中的所述特征信息相符的标识信息所对应的配置项,并从查找出的配置项的配置属性中获取对应的告警目标,将所述告警信息发送至获取到的告警目标。The execution unit is configured to find a configuration item corresponding to the identification information in the CMDB that matches the characteristic information in the alarm information by executing a preset script file, and obtain the configuration item from the configuration attribute of the found configuration item. The corresponding alarm target sends the alarm information to the acquired alarm target.
  7. 如权利要求6所述的装置,其特征在于,所述配置信息包括所述标识信息和多个告警信息组,每个所述告警信息组包括所述告警目标和与所述告警目标对应的告警阈值,所述构建单元,包括:The apparatus according to claim 6, wherein the configuration information includes the identification information and a plurality of alarm information groups, and each of the alarm information groups includes the alarm target and an alarm corresponding to the alarm target Threshold, the building unit includes:
    第一构建子单元,用于根据所述配置信息构建所述CMDB,其中,所述配置项中存入有所述标识信息,所述配置项对应有多个所述配置属性,每个所述配置属性中存入有一个所述告警信息组;A first constructing subunit configured to construct the CMDB according to the configuration information, wherein the configuration item stores the identification information, and the configuration item corresponds to a plurality of the configuration attributes, each of which One configuration of the alarm information group is stored in the configuration attribute;
    所述执行单元,包括:The execution unit includes:
    分析单元,用于对所述告警信息进行分析,得到所述告警信息的告警值,所述告警值指示所述告警信息的严重程度;An analysis unit, configured to analyze the alarm information to obtain an alarm value of the alarm information, where the alarm value indicates a severity of the alarm information;
    遍历单元,用于遍历查找出的所述配置项对应的多个所述配置属性中的所述告警信息组,将小于或等于所述告警值的所述告警阈值所对应的所述告警信息组中的所述告警目标添加至目标集,并将所述告警信息发送至所述目标集中的所述告警目标。The traversal unit is configured to traverse the alarm information group in the plurality of configuration attributes corresponding to the found configuration item, and the alarm information group corresponding to the alarm threshold value that is less than or equal to the alarm value The alarm target in is added to a target set, and the alarm information is sent to the alarm target in the target set.
  8. 如权利要求7所述的装置,其特征在于,所述配置信息还包括与所述当前参数对应的多个权值,所述构建单元,包括:The apparatus according to claim 7, wherein the configuration information further includes a plurality of weights corresponding to the current parameter, and the construction unit includes:
    第二构建子单元,用于根据所述配置信息构建所述CMDB,其中,所述配置项中存入有所述标识信息,所述配置项对应有多个所述配置属性,每个所述配置属性中存入有一个所述告警信息组以及所述多个权值;A second construction subunit is configured to construct the CMDB according to the configuration information, wherein the identification information is stored in the configuration item, and the configuration item corresponds to a plurality of the configuration attributes, each of which One configuration of the alarm information group and the plurality of weight values are stored in the configuration attributes;
    所述分析单元,包括:The analysis unit includes:
    查找单元,用于查找所述CMDB中的与所述告警信息中的所述特征信息相符的所述标识信息所对应的所述配置项,并获取与查找出的所述配置项对应的任意一个所述配置属性中的所述多个权值,基于所述多个权值对所述告警信息进行加权求和,得到所述告警值。A searching unit, configured to search the configuration item corresponding to the identification information in the CMDB that matches the characteristic information in the alarm information, and obtain any one corresponding to the found configuration item The plurality of weight values in the configuration attribute are obtained by weighting and adding the alarm information based on the plurality of weight values to obtain the alarm value.
  9. 如权利要求6所述的装置,其特征在于,所述第二获取单元,包括:The apparatus according to claim 6, wherein the second obtaining unit comprises:
    搭建单元,用于在所述目标数据库的主机搭建zabbix客户端;A building unit for building a zabbix client on the host of the target database;
    创建单元,用于创建zabbix监控项,所述zabbix监控项的监控目标为所述zabbix客户端中的所述目标数据库;A creating unit, configured to create a zabbix monitoring item, and a monitoring target of the zabbix monitoring item is the target database in the zabbix client;
    赋予单元,用于对所述zabbix监控项赋予一次执行权限,当通过执行所述zabbix监控项得到的数据与所述当前参数的格式符合时,对所述zabbix监控项赋予自动执行的执行权限。The assigning unit is configured to assign an execution permission to the Zabbix monitoring item once. When the data obtained by executing the Zabbix monitoring item matches the format of the current parameter, the Zabbix monitoring item is given an automatic execution execution permission.
  10. 如权利要求6所述的装置,其特征在于,所述预设条件包括多个告警等级,所述生成单元,包括:The apparatus according to claim 6, wherein the preset condition includes a plurality of alarm levels, and the generating unit includes:
    等级确定单元,用于从所述多个告警等级中确定所述当前参数符合的所述告警等级;A level determining unit, configured to determine, from the multiple alarm levels, the alarm level that the current parameter complies with;
    添加单元,用于将所述当前参数符合的所述告警等级和所述当前参数添加至预设的告警信息模板,生成所述告警信息。An adding unit is configured to add the alarm level and the current parameter that the current parameters meet to a preset alarm information template to generate the alarm information.
  11. 一种终端设备,其特征在于,包括存储器以及处理器,所述存储器中存储有可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:A terminal device includes a memory and a processor, and the memory stores computer-readable instructions that can be run on the processor. When the processor executes the computer-readable instructions, the following steps are implemented: :
    获取与待设置告警的目标数据库相关的配置信息,所述配置信息包括目标数据库的标识信息和与所述目标数据库对应的告警目标;Acquiring configuration information related to a target database to which an alarm is to be set, the configuration information including identification information of the target database and an alarm target corresponding to the target database;
    根据所述配置信息构建配置管理数据库CMDB,其中,所述CMDB对应有配置项,所述配置项中存入有所述标识信息,所述配置项对应的配置属性中存入有所述告警目标;Build a configuration management database CMDB according to the configuration information, wherein the CMDB corresponds to a configuration item, the identification information is stored in the configuration item, and the alarm target is stored in a configuration attribute corresponding to the configuration item ;
    获取所述目标数据库的当前参数,所述当前参数包括所述目标数据库的特征信息、每秒操作次数以及当前流量,所述特征信息包括所述目标数据库的名称;Acquiring current parameters of the target database, where the current parameters include characteristic information of the target database, operations per second, and current traffic, and the characteristic information includes a name of the target database;
    当所述当前参数符合预设条件时,生成包含所述当前参数的告警信息;When the current parameter meets a preset condition, generating alarm information including the current parameter;
    通过执行预设的脚本文件查找所述CMDB中与所述告警信息中的所述特征信息相符的标识信息所对应的配置项,并从查找出的配置项的配置属性中获取对应的告警目标,将所述告警信息发送至获取到的告警目标。Find a configuration item corresponding to the identification information in the CMDB that matches the characteristic information in the alarm information by executing a preset script file, and obtain a corresponding alarm target from the configuration attribute of the found configuration item, And sending the alarm information to the acquired alarm target.
  12. 如权利要求11所述的终端设备,其特征在于,所述配置信息包括所述标识信息和多个告警信息组,每个所述告警信息组包括所述告警目标和与所述告警目标对应的告警阈值,所述根据所述配置信息构建配置管理数据库CMDB,包括:The terminal device according to claim 11, wherein the configuration information includes the identification information and a plurality of alarm information groups, and each of the alarm information groups includes the alarm target and a corresponding alarm target. An alarm threshold, and the constructing a configuration management database CMDB according to the configuration information includes:
    根据所述配置信息构建所述CMDB,其中,所述配置项中存入有所述标识信息,所述配置项对应有多个所述配置属性,每个所述配置属性中存入有一个所述告警信息组;The CMDB is constructed according to the configuration information, wherein the identification information is stored in the configuration item, the configuration item corresponds to a plurality of the configuration attributes, and each of the configuration attributes stores one Said alarm information group;
    所述从查找出的配置项的配置属性中获取对应的告警目标,将所述告警信息发送至获取到的告警目标,包括:The acquiring the corresponding alarm target from the configuration attributes of the found configuration item, and sending the alarm information to the acquired alarm target includes:
    对所述告警信息进行分析,得到所述告警信息的告警值,所述告警值指示所述告警信息的严重程度;Analyzing the alarm information to obtain an alarm value of the alarm information, where the alarm value indicates the severity of the alarm information;
    遍历查找出的所述配置项对应的多个所述配置属性中的所述告警信息组,将小于或等于所述告警值的所述告警阈值所对应的所述告警信息组中的所述告警目标添加至目标集,并将所述告警信息发送至所述目标集中的所述告警目标。Traversing the alarm information group in the plurality of configuration attributes corresponding to the configuration item found will traverse the alarm in the alarm information group corresponding to the alarm threshold that is less than or equal to the alarm value A target is added to the target set, and the alarm information is sent to the alarm target in the target set.
  13. 如权利要求12所述的终端设备,其特征在于,所述配置信息还包括与所述当前参数对应的多个权值,所述根据所述配置信息构建所述CMDB,其中,所述配置项中存入有所述标识信息,所述配置项对应有多个所述配置属性,每个所述配置属性中存入有一个所述告警信息组,包括:The terminal device according to claim 12, wherein the configuration information further comprises a plurality of weights corresponding to the current parameter, and the CMDB is constructed according to the configuration information, wherein the configuration item The identification information is stored in the configuration item, and the configuration item corresponds to a plurality of the configuration attributes. Each of the configuration attributes stores one alarm information group, including:
    根据所述配置信息构建所述CMDB,其中,所述配置项中存入有所述标识信息,所述配置项对应有多个所述配置属性,每个所述配置属性中存入有一个所述告警信息组以及所述多个权值;The CMDB is constructed according to the configuration information, wherein the identification information is stored in the configuration item, the configuration item corresponds to a plurality of the configuration attributes, and each of the configuration attributes stores one The alarm information group and the multiple weights;
    所述对所述告警信息进行分析,得到所述告警信息的告警值,包括:The analyzing the alarm information to obtain an alarm value of the alarm information includes:
    查找所述CMDB中的与所述告警信息中的所述特征信息相符的所述标识信息所对应的所述配置项,并获取与查找出的所述配置项对应的任意一个所述配置属性中的所述多个权值,基于所述多个权值对所述告警信息进行加权求和,得到所述告警值。Find the configuration item corresponding to the identification information in the CMDB that matches the characteristic information in the alarm information, and obtain any one of the configuration attributes corresponding to the found configuration item The weighted summation of the plurality of weight values based on the plurality of weight values to obtain the alarm value.
  14. 如权利要求11所述的终端设备,其特征在于,所述获取所述目标数据库的当前参数,包括:The terminal device according to claim 11, wherein the acquiring the current parameters of the target database comprises:
    在所述目标数据库的主机搭建zabbix客户端;Building a zabbix client on the host of the target database;
    创建zabbix监控项,所述zabbix监控项的监控目标为所述zabbix客户端中的所述目标数据库;Create a zabbix monitoring item, and the monitoring target of the zabbix monitoring item is the target database in the zabbix client;
    对所述zabbix监控项赋予一次执行权限,当通过执行所述zabbix监控项得到的数据与所述当前参数的格式符合时,对所述zabbix监控项赋予自动执行的执行权限。The Zabbix monitoring item is given an execution permission once, and when the data obtained by executing the Zabbix monitoring item matches the format of the current parameter, the Zabbix monitoring item is given an automatic execution execution permission.
  15. 根据权利要求11所述的终端设备,其特征在于,所述预设条件包括多个告警等级,所述当所述当前参数符合预设条件时,生成包含所述当前参数的告警信息,包括:The terminal device according to claim 11, wherein the preset condition includes multiple alarm levels, and when the current parameter meets the preset condition, generating alarm information including the current parameter includes:
    从所述多个告警等级中确定所述当前参数符合的所述告警等级;Determining, from the plurality of alarm levels, the alarm level to which the current parameter complies;
    将所述当前参数符合的所述告警等级和所述当前参数添加至预设的告警信息模板,生成所述告警信息。Adding the alarm level and the current parameter that the current parameters meet to a preset alarm information template to generate the alarm information.
  16. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可读指令,其特征在于,所述计算机可读指令被至少一个处理器执行时实现如下步骤:A computer-readable storage medium storing computer-readable instructions, wherein the computer-readable instructions implement the following steps when executed by at least one processor:
    获取与待设置告警的目标数据库相关的配置信息,所述配置信息包括目标数据库的标识信息和与所述目标数据库对应的告警目标;Acquiring configuration information related to a target database to which an alarm is to be set, the configuration information including identification information of the target database and an alarm target corresponding to the target database;
    根据所述配置信息构建配置管理数据库CMDB,其中,所述CMDB对应有配置项,所述配置项中存入有所述标识信息,所述配置项对应的配置属性中存入有所述告警目标;Build a configuration management database CMDB according to the configuration information, wherein the CMDB corresponds to a configuration item, the identification information is stored in the configuration item, and the alarm target is stored in a configuration attribute corresponding to the configuration item ;
    获取所述目标数据库的当前参数,所述当前参数包括所述目标数据库的特征信息、每秒操作次数以及当前流量,所述特征信息包括所述目标数据库的名称;Acquiring current parameters of the target database, where the current parameters include characteristic information of the target database, operations per second, and current traffic, and the characteristic information includes a name of the target database;
    当所述当前参数符合预设条件时,生成包含所述当前参数的告警信息;When the current parameter meets a preset condition, generating alarm information including the current parameter;
    通过执行预设的脚本文件查找所述CMDB中与所述告警信息中的所述特征信息相符的标识信息所对应的配置项,并从查找出的配置项的配置属性中获取对应的告警目标,将所述告警信息发送至获取到的告警目标。Find a configuration item corresponding to the identification information in the CMDB that matches the characteristic information in the alarm information by executing a preset script file, and obtain a corresponding alarm target from the configuration attribute of the found configuration item, And sending the alarm information to the acquired alarm target.
  17. 根据权利要求16所述的计算机可读存储介质,其特征在于,获取与待设置告警的目标数据库相关的配置信息,所述配置信息包括目标数据库的标识信息和与所述目标数据库对应的告警目标;The computer-readable storage medium according to claim 16, wherein configuration information related to a target database to which an alarm is to be set is obtained, wherein the configuration information includes identification information of the target database and an alarm target corresponding to the target database ;
    根据所述配置信息构建配置管理数据库CMDB,其中,所述CMDB对应有配置项,所述配置项中存入有所述标识信息,所述配置项对应的配置属性中存入有所述告警目标;Build a configuration management database CMDB according to the configuration information, wherein the CMDB corresponds to a configuration item, the identification information is stored in the configuration item, and the alarm target is stored in a configuration attribute corresponding to the configuration item ;
    获取所述目标数据库的当前参数,所述当前参数包括所述目标数据库的特征信息、每秒操作次数以及当前流量,所述特征信息包括所述目标数据库的名称;Acquiring current parameters of the target database, where the current parameters include characteristic information of the target database, operations per second, and current traffic, and the characteristic information includes a name of the target database;
    当所述当前参数符合预设条件时,生成包含所述当前参数的告警信息;When the current parameter meets a preset condition, generating alarm information including the current parameter;
    通过执行预设的脚本文件查找所述CMDB中与所述告警信息中的所述特征信息相符的标识信息所对应的配置项,并从查找出的配置项的配置属性中获取对应的告警目标,将所述告警信息发送至获取到的告警目标。Find a configuration item corresponding to the identification information in the CMDB that matches the characteristic information in the alarm information by executing a preset script file, and obtain a corresponding alarm target from the configuration attribute of the found configuration item, And sending the alarm information to the acquired alarm target.
  18. 根据权利要求17所述的计算机可读存储介质,其特征在于,所述配置信息还包括与所述当前参数对应的多个权值,所述根据所述配置信息构建所述CMDB,其中,所述配置项中存入有所述标识信息,所述配置项对应有多个所述配置属性,每个所述配置属性中存入有一个所述告警信息组,包括:The computer-readable storage medium according to claim 17, wherein the configuration information further comprises a plurality of weights corresponding to the current parameter, and the CMDB is constructed according to the configuration information, wherein, all The configuration item stores the identification information, the configuration item corresponds to a plurality of the configuration attributes, and each of the configuration attributes stores one of the alarm information groups, including:
    根据所述配置信息构建所述CMDB,其中,所述配置项中存入有所述标识信息,所述配置项对应有多个所述配置属性,每个所述配置属性中存入有一个所述告警信息组以及所述多个权值;The CMDB is constructed according to the configuration information, wherein the identification information is stored in the configuration item, the configuration item corresponds to a plurality of the configuration attributes, and each of the configuration attributes stores one The alarm information group and the multiple weights;
    所述对所述告警信息进行分析,得到所述告警信息的告警值,包括:The analyzing the alarm information to obtain an alarm value of the alarm information includes:
    查找所述CMDB中的与所述告警信息中的所述特征信息相符的所述标识信息所对应的所述配置项,并获取与查找出的所述配置项对应的任意一个所述配置属性中的所述多个权值,基于所述多个权值对所述告警信息进行加权求和,得到所述告警值。Find the configuration item corresponding to the identification information in the CMDB that matches the characteristic information in the alarm information, and obtain any one of the configuration attributes corresponding to the found configuration item The weighted summation of the plurality of weight values based on the plurality of weight values to obtain the alarm value.
  19. 根据权利要求16所述的计算机可读存储介质,其特征在于,所述获取所述目标数据库的当前参数,包括:The computer-readable storage medium according to claim 16, wherein the acquiring the current parameters of the target database comprises:
    在所述目标数据库的主机搭建zabbix客户端;Building a zabbix client on the host of the target database;
    创建zabbix监控项,所述zabbix监控项的监控目标为所述zabbix客户端中的所述目标数据库;Create a zabbix monitoring item, and the monitoring target of the zabbix monitoring item is the target database in the zabbix client;
    对所述zabbix监控项赋予一次执行权限,当通过执行所述zabbix监控项得到的数据与所述当前参数的格式符合时,对所述zabbix监控项赋予自动执行的执行权限。The Zabbix monitoring item is given an execution permission once, and when the data obtained by executing the Zabbix monitoring item matches the format of the current parameter, the Zabbix monitoring item is given an automatic execution execution permission.
  20. 根据权利要求16所述的计算机可读存储介质,其特征在于,所述预设条件包括多个告警等级,所述当所述当前参数符合预设条件时,生成包含所述当前参数的告警信息,包括:The computer-readable storage medium of claim 16, wherein the preset condition includes multiple alarm levels, and when the current parameter meets the preset condition, generating alarm information including the current parameter ,include:
    从所述多个告警等级中确定所述当前参数符合的所述告警等级;Determining, from the plurality of alarm levels, the alarm level to which the current parameter complies;
    将所述当前参数符合的所述告警等级和所述当前参数添加至预设的告警信息模板,生成所述告警信息。Adding the alarm level and the current parameter that the current parameters meet to a preset alarm information template to generate the alarm information.
PCT/CN2018/105555 2018-06-27 2018-09-13 Database automatic alarming method and apparatus, terminal device, and readable storage medium WO2020000676A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810675189.2 2018-06-27
CN201810675189.2A CN109086182B (en) 2018-06-27 2018-06-27 Automatic database alarming method and terminal equipment

Publications (1)

Publication Number Publication Date
WO2020000676A1 true WO2020000676A1 (en) 2020-01-02

Family

ID=64839857

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/105555 WO2020000676A1 (en) 2018-06-27 2018-09-13 Database automatic alarming method and apparatus, terminal device, and readable storage medium

Country Status (2)

Country Link
CN (1) CN109086182B (en)
WO (1) WO2020000676A1 (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110069378A (en) * 2019-03-16 2019-07-30 平安城市建设科技(深圳)有限公司 Data monitoring method, device, terminal and computer readable storage medium
CN110290190A (en) * 2019-06-18 2019-09-27 深圳前海微众银行股份有限公司 A kind of method, monitored device and monitoring server acquiring data
CN110557281B (en) * 2019-08-21 2022-04-26 北京市天元网络技术股份有限公司 Intelligent operation and maintenance method and device based on CMDB and alarm map
CN113051120A (en) * 2019-12-26 2021-06-29 医渡云(北京)技术有限公司 Data monitoring method and device, readable medium and electronic equipment
CN111258798A (en) * 2020-01-14 2020-06-09 平安壹钱包电子商务有限公司 Fault positioning method and device for monitoring data, computer equipment and storage medium
CN111611137A (en) * 2020-06-30 2020-09-01 平安银行股份有限公司 Alarm monitoring method and device, computer equipment and storage medium
CN113760344A (en) * 2020-07-06 2021-12-07 北京沃东天骏信息技术有限公司 Dynamic configuration method, device, electronic equipment and storage medium
CN114338350A (en) * 2021-12-30 2022-04-12 北京汇通天下物联科技有限公司 Alarm method, alarm device, electronic equipment and computer storage medium
CN115221009A (en) * 2022-09-19 2022-10-21 中国人寿保险股份有限公司上海数据中心 Monitoring and alarming integrated system of credit creation database and implementation method thereof
CN116450622B (en) * 2023-06-16 2023-09-22 建信金融科技有限责任公司 Method, apparatus, device and computer readable medium for data warehouse entry

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103605722A (en) * 2013-11-15 2014-02-26 北京奇虎科技有限公司 Method, device and equipment for database monitoring
CN103794033A (en) * 2014-02-27 2014-05-14 广州杰赛科技股份有限公司 Monitoring alarm method and device
CN104183082A (en) * 2014-08-12 2014-12-03 上海天奕达电子科技有限公司 Alarm processing strategy method and alarm processing strategy system
WO2018111463A1 (en) * 2016-12-12 2018-06-21 Walmart Apollo, Llc Dynamic alert system in a facility

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2361465B1 (en) * 2008-10-15 2012-08-29 Hewlett-Packard Development Company, L.P. Retrieving configuration records from a configuration management database
CN103607295A (en) * 2013-10-31 2014-02-26 南京中兴新软件有限责任公司 Alarm processing method and alarm system
CN105843904B (en) * 2016-03-23 2019-04-05 江苏太湖云计算信息技术股份有限公司 For the monitoring warning system of database runnability
CN107273390A (en) * 2016-04-09 2017-10-20 上海久畅信息技术有限公司 Management method based on SQL script flow media databases

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103605722A (en) * 2013-11-15 2014-02-26 北京奇虎科技有限公司 Method, device and equipment for database monitoring
CN103794033A (en) * 2014-02-27 2014-05-14 广州杰赛科技股份有限公司 Monitoring alarm method and device
CN104183082A (en) * 2014-08-12 2014-12-03 上海天奕达电子科技有限公司 Alarm processing strategy method and alarm processing strategy system
WO2018111463A1 (en) * 2016-12-12 2018-06-21 Walmart Apollo, Llc Dynamic alert system in a facility

Also Published As

Publication number Publication date
CN109086182A (en) 2018-12-25
CN109086182B (en) 2021-08-13

Similar Documents

Publication Publication Date Title
WO2020000676A1 (en) Database automatic alarming method and apparatus, terminal device, and readable storage medium
US11741100B2 (en) Providing matching security between data stores in a database system
US9432358B2 (en) System and method of authenticating user account login request messages
JP6160064B2 (en) Application determination program, failure detection apparatus, and application determination method
US20180349250A1 (en) Content-level anomaly detector for systems with limited memory
US11869014B2 (en) Physical proximity graphing
CN109450969B (en) Method and device for acquiring data from third-party data source server and server
US20220222266A1 (en) Monitoring and alerting platform for extract, transform, and load jobs
WO2018233630A1 (en) Fault discovery
CN112000992B (en) Data leakage prevention protection method and device, computer readable medium and electronic equipment
KR20190130933A (en) Method and apparatus for constructing data based blockchain
US11366821B2 (en) Epsilon-closure for frequent pattern analysis
WO2023231341A1 (en) Method and apparatus for discovering data asset risk
WO2018200167A1 (en) Managing asynchronous analytics operation based on communication exchange
US11349926B1 (en) Protected smart contracts for managing internet of things devices
CN109062642B (en) Control message notification method and device
US9832196B2 (en) Network monitoring device
CN111552703A (en) Data processing method and device
CN110968267A (en) Data management method, device, server and system
CN110601905A (en) Fault detection method and device
WO2020006868A1 (en) Automatic alarm method and apparatus for tablespace, terminal device and readable storage medium
US20150154196A1 (en) Alerting system based on newly disambiguated features
US11882124B1 (en) Account integration with an event-driven application programing interface call manager
CN113973014B (en) Method, device and equipment for monitoring weak password loopholes of network equipment
CN111125223B (en) Database connection pool updating method and device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18923898

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18923898

Country of ref document: EP

Kind code of ref document: A1