CN108959468B - Monitoring method of database directory, storage medium and server - Google Patents

Monitoring method of database directory, storage medium and server Download PDF

Info

Publication number
CN108959468B
CN108959468B CN201810634316.4A CN201810634316A CN108959468B CN 108959468 B CN108959468 B CN 108959468B CN 201810634316 A CN201810634316 A CN 201810634316A CN 108959468 B CN108959468 B CN 108959468B
Authority
CN
China
Prior art keywords
alarm
database
information
time
directory
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201810634316.4A
Other languages
Chinese (zh)
Other versions
CN108959468A (en
Inventor
孙泽祥
梁海安
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201810634316.4A priority Critical patent/CN108959468B/en
Priority to PCT/CN2018/105531 priority patent/WO2019242123A1/en
Publication of CN108959468A publication Critical patent/CN108959468A/en
Application granted granted Critical
Publication of CN108959468B publication Critical patent/CN108959468B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/14Details of searching files based on file metadata
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Library & Information Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention relates to the technical field of communication, and provides a monitoring method, a storage medium and a server of a database directory. The monitoring method of the database catalog comprises the following steps: accessing data dictionary information of a target database; determining a database catalog to be monitored according to the accessed data dictionary information; acquiring directory information of the database directory by using a preset script file; constructing monitoring items of a database directory according to the directory information; and sending the monitoring item to a zabbix server so that the zabbix server monitors the database catalog. According to the process, the directory information of the database directory to be monitored can be determined by accessing the data dictionary information of the database, then the monitoring item can be automatically constructed according to the directory information, and the constructed monitoring item is sent to the zabbix server for monitoring.

Description

Monitoring method of database directory, storage medium and server
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method for monitoring a database directory, a storage medium, and a server.
Background
The database directory is where the database server stores data files, and includes not only files of related tables, but also data files, server option files, and the like. Currently, database catalogs are typically monitored using database monitoring products such as zabbix. However, the user needs to manually define the monitoring item in zabbix to realize the monitoring of one or more database directories, and the operation efficiency is low.
Disclosure of Invention
In view of this, the embodiments of the present invention provide a method, a storage medium, and a server for monitoring a database directory, which aim to solve the problem of low operation efficiency when monitoring the database directory.
In a first aspect of an embodiment of the present invention, a method for monitoring a database directory is provided, including:
accessing data dictionary information of a target database, wherein the data dictionary information is readable information for recording metadata of the database;
determining a database catalog to be monitored according to the accessed data dictionary information;
acquiring directory information of the database directory by using a preset script file;
constructing monitoring items of a database directory according to the directory information;
and sending the monitoring item to a zabbix server so that the zabbix server monitors the database catalog.
In a second aspect of the embodiments of the present invention, there is provided a computer readable storage medium storing computer readable instructions which, when executed by a processor, implement the steps of a method for monitoring a database catalog as set forth in the first aspect of the embodiments of the present invention.
In a third aspect of the embodiments of the present invention, there is provided a server comprising a memory, a processor and computer readable instructions stored in the memory and executable on the processor, the processor executing the computer readable instructions to perform the steps of:
accessing data dictionary information of a target database, wherein the data dictionary information is readable information for recording metadata of the database;
determining a database catalog to be monitored according to the accessed data dictionary information;
acquiring directory information of the database directory by using a preset script file;
constructing monitoring items of a database directory according to the directory information;
and sending the monitoring item to a zabbix server so that the zabbix server monitors the database catalog.
The method for monitoring the database catalogue provided by the embodiment of the invention comprises the following steps: accessing data dictionary information of a target database; determining a database catalog to be monitored according to the accessed data dictionary information; acquiring directory information of the database directory by using a preset script file; constructing monitoring items of a database directory according to the directory information; and sending the monitoring item to a zabbix server so that the zabbix server monitors the database catalog. According to the process, the directory information of the database directory to be monitored can be determined by accessing the data dictionary information of the database, then the monitoring item can be automatically constructed according to the directory information, and the constructed monitoring item is sent to the zabbix server for monitoring.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments or the description of the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a first embodiment of a method for monitoring a database directory according to an embodiment of the present invention;
FIG. 2 is a flowchart of a second embodiment of a method for monitoring a database directory according to an embodiment of the present invention;
FIG. 3 is a block diagram of one embodiment of a database directory monitoring device provided by an embodiment of the present invention;
fig. 4 is a schematic diagram of a server according to an embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a monitoring method, a storage medium and a server for a database directory, and aims to solve the problem of low operation efficiency when the database directory is monitored.
In order to make the objects, features and advantages of the present invention more comprehensible, the technical solutions in the embodiments of the present invention are described in detail below with reference to the accompanying drawings, and it is apparent that the embodiments described below are only some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 1, a first embodiment of a method for monitoring a database directory includes:
101. accessing data dictionary information of a target database;
the target database is a database to be monitored, the data dictionary information is readable information for recording metadata of the database, such as system views provided by the database, and metadata information of the database, such as table space of the database, physical file paths of the database and the like, can be obtained through the views. Corresponding data access commands can be constructed to access the data dictionary information of the target database.
Specifically, step 101 may include:
(1) Acquiring system information of the terminal equipment by using a preset script file;
(2) Constructing a corresponding data access command according to the system information;
(3) And accessing the data dictionary information of the target database by adopting the data access command.
And (2) for the step (1), acquiring the system information of the terminal equipment by using a preset script file. For example, standardized shell or python scripts may be used to obtain system information of the terminal, where the obtained system information may include aix, sun, hp-ux or linux, etc.
And (2) constructing a corresponding data access command according to the system information. The form of the data access commands employed will also vary from system to system, and thus it is necessary to construct the appropriate data access commands based on specific system information.
For the above step (3), the data dictionary information of the target database is accessed using the data access command, where the data access command is an instruction matching with the terminal system.
102. Determining a database catalog to be monitored according to the accessed data dictionary information;
after accessing the data dictionary information of the target database, determining a database directory to be monitored according to the accessed data dictionary information. By accessing the data dictionary information, metadata information of the target database can be acquired, and by the metadata information, information such as a table space, a storage path of each physical file and the like of the target database can be determined, so that a database directory of the target database can be determined. In practical application, all directories of the target database can be obtained, and then SQL commands are adopted to remove the duplicate of the directories, so that the database directory to be monitored is obtained.
103. Acquiring directory information of the database directory by using a preset script file;
and after determining the database catalogue to be monitored, acquiring the catalogue information of the database catalogue by using a preset script file. In particular, standardized shell or python scripts may be used to obtain the directory information of the database directory. In the script, corresponding commands are executed to obtain directory information such as directory size, directory residual space, directory utilization rate and the like according to a specific host platform system.
104. Constructing monitoring items of a database directory according to the directory information;
after obtaining the catalog information, constructing monitoring items of the database catalog according to the catalog information.
Further, step 104 may include:
(1) Acquiring a predefined universal monitoring item, wherein the universal monitoring item comprises a universal catalog name;
(2) Extracting a directory name to be monitored from the directory information;
(3) And replacing the universal catalog names in the universal monitoring items with the extracted catalog names to obtain the monitoring items of the database catalog.
A predefined generic monitoring item is obtained, the generic monitoring item comprising a generic directory name. For example, oracle. Asm. Size [ { #PATH_NAME }, used_pct ] represents a general monitoring item for monitoring the directory usage, oracle. Asm. Size is the NAME identification of the monitoring item, { #PATH_NAME } is a variable representing a general directory NAME, used_pt represents the directory usage, and is a monitoring attribute of the directory. And extracting the directory NAME to be monitored, and replacing { #PATH_NAME } in the monitoring item by the extracted directory NAME to obtain the constructed monitoring item.
For example, a directory usage monitoring item constructed from the generic monitoring item is: "oracle. Asm. Size [/pad/app/oracle/rdbms, used-pct ]"35.46.
Where/pad/app/oracle/rdbms represents the monitored directory, 35.46 represents the specific value of the monitored item, i.e. the directory usage is 35.46%, and the information/pad/app/oracle/rdbms and 35.46 can be obtained from the directory information.
105. And sending the monitoring item to a zabbix server so that the zabbix server monitors the database catalog.
After the monitoring items of the database catalog are built, the monitoring items are sent to the zabbix server, and the zabbix server monitors the monitoring items, namely the database catalog of the target database.
The method for monitoring the database catalogue provided by the embodiment of the invention comprises the following steps: accessing data dictionary information of a target database; determining a database catalog to be monitored according to the accessed data dictionary information; acquiring directory information of the database directory by using a preset script file; constructing monitoring items of a database directory according to the directory information; and sending the monitoring item to a zabbix server so that the zabbix server monitors the database catalog. According to the process, the directory information of the database directory to be monitored can be determined by accessing the data dictionary information of the database, then the monitoring item can be automatically constructed according to the directory information, and the constructed monitoring item is sent to the zabbix server for monitoring.
Referring to fig. 2, a second embodiment of a method for monitoring a database directory according to an embodiment of the present invention includes:
201. accessing data dictionary information of a target database;
202. determining a database catalog to be monitored according to the accessed data dictionary information;
203. acquiring directory information of the database directory by using a preset script file;
204. constructing monitoring items of a database directory according to the directory information;
205. sending the monitoring item to a zabbix server;
steps 201-205 are identical to steps 101-105, and reference is made specifically to the description of steps 101-105.
206. Constructing a corresponding alarm threshold for the received monitoring item;
after receiving the monitoring items, the zabbix server may construct corresponding alarm thresholds for the monitoring items. For example, for the directory usage monitoring term oracle. Asm. Size [/carboxylic/app/oracle/rdbms, used_pct ], an alarm threshold 80 may be set, i.e., if directory usage is monitored to exceed 80%, an alarm event may be triggered.
In addition, the drawing function of the zabbix server can be utilized to draw all the collected values of the monitoring item according to time sequence, and the value and the change trend of the monitoring item at each time point can be graphically and intuitively displayed.
207. If the value of the monitoring item is monitored to exceed the alarm threshold value, generating preset alarm information;
208. after the preset alarm information is generated, an alarm mail is constructed and sent according to the alarm information.
The zabbix server monitors the value of each monitoring item, if the value of a certain monitoring item is monitored to exceed a set alarm threshold, preset alarm information is generated, and the alarm information generally can comprise information such as the name of an alarm object (such as XX catalog monitoring item), alarm time and alarm intensity. After the preset alarm information is generated, a mail alarm program can be called, and an alarm mail is constructed and sent according to the alarm information so as to inform relevant personnel of the attention.
However, in a period of time, a monitoring item may have a phenomenon of exceeding a threshold for multiple times, and if an alarm mail is sent every time the threshold is exceeded, unnecessary disturbance is caused to related personnel. Therefore, in order to avoid frequent sending of the alarm mail, the name of the alarm object can be used as alarm information, and after the preset alarm information is generated, before the alarm mail is constructed and sent according to the alarm information, the following method is adopted for processing:
(1) Inquiring whether an alarm record of the alarm object exists in a preset alarm record table according to the name of the alarm object;
(2) If the alarm record of the alarm object does not exist, constructing the alarm record for the alarm object, and then executing the steps of constructing and sending an alarm mail according to the alarm information.
Specifically, an alarm record table can be set in the postgreSQL database, and each time alarm information is generated, whether corresponding alarm records exist or not is firstly inquired in the alarm record table according to the name of an alarm object; if the alarm record does not exist, the alarm event is indicated to be the primary alarm, the corresponding alarm record is generated at the moment and stored in the alarm record table, and then an alarm mail is constructed and sent according to the alarm information. If the alarm record exists, the alarm event is not the primary alarm, the related alarm mail is sent, and the alarm mail can not be sent repeatedly at the moment.
Still further, the alarm record includes an alarm object name, an alarm number, an alarm mail sending time, and a record update time, and the method may further include:
(3) If the alarm record of the alarm object exists, judging whether the interval between the current time and the record updating time is larger than a first duration or not;
(4) If the interval between the current time and the record updating time is longer than the first duration, updating the alarm times, the alarm mail sending time and the record updating time, and then executing the steps of constructing and sending the alarm mail according to the alarm information;
(5) If the interval between the current time and the record updating time is smaller than or equal to the first duration, judging whether the interval between the sending time of the alarm mail and the record updating time is larger than a second duration; if the interval between the sending time of the alarm mail and the record updating time is smaller than or equal to the second duration, updating the alarm times and the record updating time, and then returning to the step of monitoring the value of the monitoring item; if the interval between the sending time of the alarm mail and the recording updating time is larger than the second duration, updating the alarm times, the sending time of the alarm mail and the recording updating time, and then executing the steps of constructing and sending the alarm mail according to the alarm information.
The alarm record comprises a plurality of data such as the name of an alarm object, the alarm times, the sending time of the alarm mail, the record updating time and the like, wherein the alarm times refer to the times of the alarm object for generating alarm information, the sending time of the alarm mail refers to the last sending time of the alarm mail, and the record updating time refers to the last updating time of the alarm record. When an alarm record of a certain alarm object is created, the alarm times are recorded as 1 time, and the sending time and the record updating time of the alarm mail can be recorded as the current system time. If the alarm record of the alarm object exists in the alarm record table, judging whether the interval between the current time and the record updating time is longer than a first duration or not; if the interval between the current time and the record update time in the alarm record table is greater than the first duration (for example, 2 minutes), which indicates that the current time is longer than the last alarm time, then an alarm mail can be sent once again, so that the alarm times, the alarm mail sending time and the record update time in the alarm record are updated, specifically, the alarm times are increased by 1, the alarm mail sending time and the record update time are replaced by the current system time, and then the alarm mail is constructed and sent according to the alarm information.
If the interval between the current time and the record updating time is smaller than or equal to the first time length, the current time is indicated to be shorter than the last alarm time, and whether the interval between the alarm mail sending time and the record updating time is larger than the second time length (for example, 5 minutes) is further judged, namely, whether the time for sending the alarm mail last time and the time for generating the alarm information last time are separated by a certain time length is judged; if the interval between the sending time of the alarm mail and the updated time of the record is smaller than or equal to the second duration, the current time is not longer than the last sending time of the alarm mail, and the repeated sending of the alarm mail is not needed at the moment, so that only the alarm times and the updated time of the record are updated, specifically, the alarm times are increased by 1, the updated time of the record is replaced by the current system time, and then the step of monitoring the value of the monitoring item is returned. If the interval between the sending time of the alarm mail and the updated time of the record is longer than the second time, the current time is longer than the last time of sending the alarm mail, and the alarm mail can be sent once again, so that the alarm times, the sending time of the alarm mail and the updated time of the record in the alarm record are updated, and then the alarm mail is constructed and sent according to the alarm information.
Further, if the interval between the sending time of the alarm mail and the updated time of the record is greater than the second duration, before updating the number of alarm times, the sending time of the alarm mail and the updated time of the record, the method may further include:
if the interval between the sending time of the alarm mail and the record updating time is smaller than a third time length and the alarm times are smaller than the first times, the steps of updating the alarm times, the sending time of the alarm mail and the record updating time are executed, and the third time length is longer than the second time length;
if the interval between the sending time of the alarm mail and the record updating time is longer than a third duration and the alarm times are smaller than a second times, the steps of updating the alarm times, the sending time of the alarm mail and the record updating time are executed, and the second times are larger than the first times;
if the alarm times are larger than the second times, updating the alarm times and recording the updating time, and then returning to the step of monitoring the value of the monitoring item.
The following are illustrated: assuming that the second time length is 5 minutes, the third time length is 1 hour, the first time is 6 times, the second time is 60 times, if the interval between the sending time of the alarm mail and the record updating time is more than 5 minutes, further judging whether the interval is less than 1 hour and the alarm time is less than 6 times, if so, updating the alarm time, the sending time of the alarm mail and the record updating time, and then sending the alarm mail; otherwise, whether the interval is more than 1 hour and the alarm times are less than 60 times can be continuously judged, if yes, the alarm times, the alarm mail sending time and the record updating time are updated, and then the alarm mail is sent. If the number of alarms exceeds 60 times, the alarm mail does not need to be repeatedly sent, the number of alarms is updated, the update time is recorded, and then the step of monitoring the value of the monitoring item is returned. Through the arrangement, the alarm information continuously generated for a certain monitoring item can be sent for the first time only about 5 minutes and about 1 hour, so that frequent sending of the alarm mail is avoided.
The method for monitoring the database catalogue provided by the embodiment of the invention comprises the following steps: accessing data dictionary information of a target database; determining a database catalog to be monitored according to the accessed data dictionary information; acquiring directory information of the database directory by using a preset script file; constructing monitoring items of a database directory according to the directory information; sending the monitoring item to a zabbix server; constructing a corresponding alarm threshold for the received monitoring item; if the value of the monitoring item is monitored to exceed the alarm threshold value, generating preset alarm information; after the preset alarm information is generated, an alarm mail is constructed and sent according to the alarm information. Compared with the first embodiment of the invention, after the value of the monitoring item is monitored to exceed the alarm threshold, the embodiment can automatically generate alarm information and send alarm mails, so that relevant personnel can process the alarm messages in time.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic, and should not limit the implementation process of the embodiment of the present invention.
The foregoing has mainly described a method for monitoring a database directory, and a device for monitoring a database directory will be described in detail.
Referring to fig. 3, an embodiment of a monitoring device for database directories in an embodiment of the present invention includes:
a data dictionary information accessing module 301, configured to access data dictionary information of a target database, where the data dictionary information is readable information for recording metadata of the database;
a database directory determining module 302, configured to determine a database directory to be monitored according to the accessed data dictionary information;
a catalog information acquisition module 303, configured to acquire catalog information of the database catalog using a preset script file;
the monitoring item construction module 304 is configured to construct monitoring items of a database directory according to the directory information;
and the monitoring item sending module 305 is configured to send the monitoring item to a zabbix server, so that the zabbix server monitors the database catalog.
Further, the data dictionary information access module may include:
a system information acquisition unit for acquiring system information of the terminal equipment by using a preset script file;
a data access command construction unit, configured to construct a corresponding data access command according to the system information;
and the data dictionary information access unit is used for accessing the data dictionary information of the target database by adopting the data access command.
Further, the monitoring item construction module may include:
the general monitoring item acquisition unit is used for acquiring a predefined general monitoring item, wherein the general monitoring item comprises a general catalog name;
a catalog name extraction unit for extracting a catalog name to be monitored from the catalog information;
and the catalog name replacing unit is used for replacing the universal catalog name in the universal monitoring item with the extracted catalog name to obtain the monitoring item of the database catalog.
Further, the monitoring item sending module may include:
the alarm threshold value construction unit is used for constructing a corresponding alarm threshold value for the received monitoring item;
the alarm information generation unit is used for generating preset alarm information if the value of the monitoring item is monitored to exceed the alarm threshold value;
and the alarm mail sending unit is used for constructing and sending alarm mails according to the alarm information after the preset alarm information is generated.
Still further, the alarm information includes a name of an alarm object, and the monitoring item transmitting module may further include:
the alarm record inquiring unit is used for inquiring whether an alarm record of the alarm object exists in a preset alarm record table according to the name of the alarm object;
and the alarm record construction unit is used for constructing an alarm record for the alarm object if the alarm record of the alarm object does not exist, and then executing the steps of constructing and sending an alarm mail according to the alarm information.
Still further, the alarm record includes an alarm object name, an alarm number, an alarm mail sending time, and a record update time, and the monitoring item sending module may further include:
the first judging unit is used for judging whether the interval between the current time and the record updating time is longer than a first duration or not if the alarm record of the alarm object exists;
the first alarm record updating unit is used for updating the alarm times, the alarm mail sending time and the record updating time if the interval between the current time and the record updating time is larger than a first duration, and then executing the steps of constructing and sending the alarm mail according to the alarm information;
a second judging unit, configured to judge whether the interval between the sending time of the alert mail and the record update time is greater than a second duration if the interval between the current time and the record update time is less than or equal to the first duration; if the interval between the sending time of the alarm mail and the record updating time is smaller than or equal to the second duration, updating the alarm times and the record updating time, and then returning to the step of monitoring the value of the monitoring item; if the interval between the sending time of the alarm mail and the recording updating time is larger than the second duration, updating the alarm times, the sending time of the alarm mail and the recording updating time, and then executing the steps of constructing and sending the alarm mail according to the alarm information.
Still further, the monitoring item transmitting module may further include:
the first execution unit is used for executing the steps of updating the alarm times, the alarm mail sending time and the record updating time if the interval between the alarm mail sending time and the record updating time is smaller than a third time length and the alarm times are smaller than the first times, wherein the third time length is longer than the second time length;
the second execution unit is used for executing the steps of updating the alarm times, the alarm mail sending time and the record updating time if the interval between the alarm mail sending time and the record updating time is longer than a third duration and the alarm times are smaller than a second times, wherein the second times are longer than the first times;
and the second alarm record updating unit is used for updating the alarm times and recording the updating time if the alarm times are larger than the second times, and then returning to the step of monitoring the value of the monitoring item.
Embodiments of the present invention also provide a computer readable storage medium storing computer readable instructions that, when executed by a processor, implement the steps of a method for monitoring any one of the database directories shown in fig. 1 or fig. 2.
The embodiment of the invention also provides a server, which comprises a memory, a processor and computer readable instructions stored in the memory and capable of running on the processor, wherein the steps of any one of the database catalogs monitoring method shown in fig. 1 or 2 are realized when the processor executes the computer readable instructions.
Fig. 4 is a schematic diagram of a server according to an embodiment of the present invention. As shown in fig. 4, the server 4 of this embodiment includes: a processor 40, a memory 41, and computer readable instructions 42 stored in the memory 41 and executable on the processor 40. The processor 40, when executing the computer readable instructions 42, implements the steps of the various database catalog monitoring method embodiments described above, such as steps 101 through 105 shown in fig. 1. Alternatively, the processor 40, when executing the computer readable instructions 42, performs the functions of the modules/units of the apparatus embodiments described above, such as the functions of modules 301-305 shown in fig. 3.
Illustratively, the computer readable instructions 42 may be partitioned into one or more modules/units that are stored in the memory 41 and executed by the processor 40 to complete the present invention. The one or more modules/units may be a series of computer readable instructions capable of performing a particular function describing the execution of the computer readable instructions 42 in the server 4.
The server 4 may be a computing device such as a desktop computer, a notebook computer, a palm computer, a cloud server, etc. The server 4 may include, but is not limited to, a processor 40, a memory 41. It will be appreciated by those skilled in the art that fig. 4 is merely an example of the server 4 and does not constitute a limitation of the server 4, and may include more or fewer components than shown, or may combine certain components, or different components, e.g., the server 4 may further include input-output devices, network access devices, buses, etc.
The processor 40 may be a central processing unit (CentraL Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (DigitaL SignaL Processor, DSP), application specific integrated circuits (AppLication Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (fierld-ProgrammabLe Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 41 may be an internal storage unit of the server 4, such as a hard disk or a memory of the server 4. The memory 41 may be an external storage device of the server 4, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure DigitaL (SD) Card, a FLash Card (FLash Card) or the like, which are provided on the server 4. Further, the memory 41 may also include both an internal storage unit and an external storage device of the server 4. The memory 41 is used to store the computer readable instructions and other programs and data required by the server. The memory 41 may also be used for temporarily storing data that has been output or is to be output.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including instructions for causing 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 according to the embodiments of the present invention. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a Read-OnLy Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for monitoring a database directory, comprising:
accessing data dictionary information of a target database, wherein the data dictionary information is readable information for recording metadata of the database;
determining a database catalog to be monitored according to the accessed data dictionary information;
acquiring directory information of the database directory by using a preset script file;
constructing monitoring items of a database directory according to the directory information;
sending the monitoring item to a zabbix server so that the zabbix server monitors the database catalog;
wherein the determining the database catalog to be monitored according to the accessed data dictionary information comprises:
determining all catalogs of the target database according to the data dictionary information;
and performing deduplication on all the catalogs by using a preset SQL command to obtain the database catalogs to be monitored.
2. The method for monitoring a database directory according to claim 1, wherein accessing the data dictionary information of the target database comprises:
acquiring system information of the terminal equipment by using a preset script file;
constructing a corresponding data access command according to the system information;
and accessing the data dictionary information of the target database by adopting the data access command.
3. The method for monitoring a database directory according to claim 1, wherein constructing a monitoring item of the database directory according to the directory information comprises:
acquiring a predefined universal monitoring item, wherein the universal monitoring item comprises a universal catalog name;
extracting a directory name to be monitored from the directory information;
and replacing the universal catalog names in the universal monitoring items with the extracted catalog names to obtain the monitoring items of the database catalog.
4. A method of monitoring a database directory according to any one of claims 1 to 3, wherein the zabbix server monitoring the database directory comprises:
constructing a corresponding alarm threshold for the received monitoring item;
if the value of the monitoring item is monitored to exceed the alarm threshold value, generating preset alarm information;
after the preset alarm information is generated, an alarm mail is constructed and sent according to the alarm information.
5. The method for monitoring a database directory according to claim 4, wherein the alarm information includes a name of an alarm object, and after generating the preset alarm information, before constructing and sending an alarm mail according to the alarm information, the method further comprises:
inquiring whether an alarm record of the alarm object exists in a preset alarm record table according to the name of the alarm object;
if the alarm record of the alarm object does not exist, constructing the alarm record for the alarm object, and then executing the steps of constructing and sending an alarm mail according to the alarm information.
6. The method of claim 5, wherein the alarm record includes an alarm object name, an alarm number, an alarm mail sending time, and a record update time, the method further comprising:
if the alarm record of the alarm object exists, judging whether the interval between the current time and the record updating time is larger than a first duration or not;
if the interval between the current time and the record updating time is longer than the first duration, updating the alarm times, the alarm mail sending time and the record updating time, and then executing the steps of constructing and sending the alarm mail according to the alarm information;
if the interval between the current time and the record updating time is smaller than or equal to the first duration, judging whether the interval between the sending time of the alarm mail and the record updating time is larger than a second duration; if the interval between the sending time of the alarm mail and the record updating time is smaller than or equal to the second duration, updating the alarm times and the record updating time, and then returning to the step of monitoring the value of the monitoring item; if the interval between the sending time of the alarm mail and the recording updating time is larger than the second duration, updating the alarm times, the sending time of the alarm mail and the recording updating time, and then executing the steps of constructing and sending the alarm mail according to the alarm information.
7. The method of claim 6, further comprising, before updating the number of alarms, the sending time of the alarm mail, and the record update time, if the interval between the sending time of the alarm mail and the record update time is greater than a second duration:
if the interval between the sending time of the alarm mail and the record updating time is smaller than a third time length and the alarm times are smaller than the first times, the steps of updating the alarm times, the sending time of the alarm mail and the record updating time are executed, and the third time length is longer than the second time length;
if the interval between the sending time of the alarm mail and the record updating time is longer than a third duration and the alarm times are smaller than a second times, the steps of updating the alarm times, the sending time of the alarm mail and the record updating time are executed, and the second times are larger than the first times;
if the alarm times are larger than the second times, updating the alarm times and recording the updating time, and then returning to the step of monitoring the value of the monitoring item.
8. A computer readable storage medium storing computer readable instructions which, when executed by a processor, implement the steps of the method of monitoring a database catalog of any one of claims 1 to 7.
9. A server comprising a memory, a processor, and computer readable instructions stored in the memory and executable on the processor, wherein the processor, when executing the computer readable instructions, performs the steps of:
accessing data dictionary information of a target database, wherein the data dictionary information is readable information for recording metadata of the database;
determining a database catalog to be monitored according to the accessed data dictionary information;
acquiring directory information of the database directory by using a preset script file;
constructing monitoring items of a database directory according to the directory information;
sending the monitoring item to a zabbix server so that the zabbix server monitors the database catalog;
wherein the determining the database catalog to be monitored according to the accessed data dictionary information comprises:
determining all catalogs of the target database according to the data dictionary information;
and performing deduplication on all the catalogs by using a preset SQL command to obtain the database catalogs to be monitored.
10. The server of claim 9, wherein the constructing the monitoring item of the database catalog from the catalog information comprises:
acquiring a predefined universal monitoring item, wherein the universal monitoring item comprises a universal catalog name;
extracting a directory name to be monitored from the directory information;
and replacing the universal catalog names in the universal monitoring items with the extracted catalog names to obtain the monitoring items of the database catalog.
CN201810634316.4A 2018-06-20 2018-06-20 Monitoring method of database directory, storage medium and server Active CN108959468B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810634316.4A CN108959468B (en) 2018-06-20 2018-06-20 Monitoring method of database directory, storage medium and server
PCT/CN2018/105531 WO2019242123A1 (en) 2018-06-20 2018-09-13 Method for monitoring database directory, storage medium, terminal device and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810634316.4A CN108959468B (en) 2018-06-20 2018-06-20 Monitoring method of database directory, storage medium and server

Publications (2)

Publication Number Publication Date
CN108959468A CN108959468A (en) 2018-12-07
CN108959468B true CN108959468B (en) 2024-02-02

Family

ID=64491415

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810634316.4A Active CN108959468B (en) 2018-06-20 2018-06-20 Monitoring method of database directory, storage medium and server

Country Status (2)

Country Link
CN (1) CN108959468B (en)
WO (1) WO2019242123A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109783449A (en) * 2018-12-13 2019-05-21 深圳壹账通智能科技有限公司 Data query processing method, platform, system and readable storage medium storing program for executing
CN109857720B (en) * 2018-12-20 2024-02-02 中国平安人寿保险股份有限公司 Database table monitoring method, device, computer device and readable storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105843904A (en) * 2016-03-23 2016-08-10 江苏太湖云计算信息技术股份有限公司 Monitoring alarm system for database operation performance

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8874755B1 (en) * 2013-07-31 2014-10-28 Splunk, Inc. Provisioning of cloud networks with services
CN103605722B (en) * 2013-11-15 2018-11-06 北京奇虎科技有限公司 Database monitoring method and device, equipment
CN105095496A (en) * 2015-08-24 2015-11-25 浪潮软件股份有限公司 Method for monitoring MYSQL table space through ZABBIX

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105843904A (en) * 2016-03-23 2016-08-10 江苏太湖云计算信息技术股份有限公司 Monitoring alarm system for database operation performance

Also Published As

Publication number Publication date
WO2019242123A1 (en) 2019-12-26
CN108959468A (en) 2018-12-07

Similar Documents

Publication Publication Date Title
US10108634B1 (en) Identification and removal of duplicate event records from a security information and event management database
US11829350B2 (en) Detection of abnormal transaction loops
CN108959468B (en) Monitoring method of database directory, storage medium and server
CN109388671B (en) Data processing method, device, equipment and storage medium
JP6633642B2 (en) Method and device for processing data blocks in a distributed database
US10114731B2 (en) Including kernel object information in a user dump
US10250550B2 (en) Social message monitoring method and apparatus
CN112506490A (en) Interface generation method and device, electronic equipment and storage medium
CN109063215B (en) Data retrieval method and device
US11181290B2 (en) Alarm processing devices, methods, and systems
CN111506564A (en) Remote data management method and device based on CS (circuit switched) architecture, computer equipment and storage medium
CN110941531A (en) Monitoring alarm method, device and equipment for monitoring alarm management platform
CN108427608B (en) Event warning method and event warning device
US9606887B2 (en) Persisting large volumes of data in an efficient unobtrusive manner
CN110555021A (en) Data storage method, query method and related device
CN113992597A (en) Cable monitoring data reporting method, device, equipment and storage medium
JP6972735B2 (en) Display control program, display control method and display control device
CN112293296A (en) Rapid response epidemic prevention method and system based on pets
CN117331919B (en) Database joint query method and device, electronic equipment and storage medium
US20160357825A1 (en) Non-transitory computer-readable recording medium, retrieval support device, and retrieval support method
WO2015184830A1 (en) Method and device for managing file in apparatus
CN112597536B (en) Real-time detection method and device for illegal deletion of database table file
US20160364813A1 (en) System for creating a linkage family tree including non-requested entities and detecting changes to the tree via an intelligent change detection system
CN116860548A (en) Method and device for automatically uploading partial fault information of vehicle machine, medium and vehicle
CN114254026A (en) Data collection and search method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant