CN109428914B - Monitoring method and device, storage medium and processor - Google Patents

Monitoring method and device, storage medium and processor Download PDF

Info

Publication number
CN109428914B
CN109428914B CN201710740576.5A CN201710740576A CN109428914B CN 109428914 B CN109428914 B CN 109428914B CN 201710740576 A CN201710740576 A CN 201710740576A CN 109428914 B CN109428914 B CN 109428914B
Authority
CN
China
Prior art keywords
address
preset
log
distributor
server
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
CN201710740576.5A
Other languages
Chinese (zh)
Other versions
CN109428914A (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.)
Beijing Gridsum Technology Co Ltd
Original Assignee
Beijing Gridsum Technology 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 Beijing Gridsum Technology Co Ltd filed Critical Beijing Gridsum Technology Co Ltd
Priority to CN201710740576.5A priority Critical patent/CN109428914B/en
Publication of CN109428914A publication Critical patent/CN109428914A/en
Application granted granted Critical
Publication of CN109428914B publication Critical patent/CN109428914B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/54Presence management, e.g. monitoring or registration for receipt of user log-on information, or the connection status of the users
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/069Management of faults, events, alarms or notifications using logs of notifications; Post-processing of notifications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network

Abstract

The invention discloses a monitoring method and device, a storage medium and a processor. Wherein, the method comprises the following steps: monitoring whether preset content exists in the target log or not, wherein the preset content is used for representing the operation of the distributor on the server; under the condition that preset content appears in the target log, analyzing the target log to obtain an analysis result; sending the parsing result to the distributor so that the distributor performs one or more of the following operations according to the parsing result: updating data information in a CMDB database, sending a notification mail and recording a log. The invention solves the technical problem that the online and offline conditions of the server cannot be monitored in time in the prior art.

Description

Monitoring method and device, storage medium and processor
Technical Field
The invention relates to the field of internet, in particular to a monitoring method and device, a storage medium and a processor.
Background
The web service high availability scheme can be made by using keepalived + lvs. The business needs to configure a plurality of back-end web services, and the back-end web services are placed on the configuration of the same group of virtual IP through the framework, if one Real Server (rs) is unavailable, the framework automatically takes the rs off line to ensure that the total service of the virtual IP is still available.
The automatic online and offline of rs is scheduled by the framework itself, and the framework can notify relevant personnel by mail only when the role of the distributor is switched (i.e. the drift of the virtual IP) at present, but there is no notification mechanism for the online or offline switching of rs. Service personnel need to know the running states of a plurality of rs at the rear end in real time, and need to manually realize monitoring. This monitoring method has the following problems:
the method is heavy and not suitable for dynamically adjusting the rs service, and monitoring the condition that the item is changed frequently; lack of history of backend host availability; a Configuration Management Database (CMDB) system has a cluster distribution information record, and if rs changes randomly, the CMDB data will be inaccurate.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a monitoring method and device, a storage medium and a processor, which at least solve the technical problem that the online and offline conditions of a server cannot be monitored in time in the prior art.
According to an aspect of an embodiment of the present invention, there is provided a monitoring method, including: monitoring whether preset content exists in a target log or not, wherein the preset content is used for representing the operation of a distributor on a cluster server; under the condition that the preset content appears in the target log, analyzing the target log to obtain an analysis result; sending the parsing result to the distributor so that the distributor performs one or more of the following operations according to the parsing result: updating data information in a configuration management database CMDB, sending a notification mail and recording a log.
Further, the analyzing result includes preset operation information, a first IP address and a second IP address, and the analyzing the target log to obtain an analyzing result includes: storing the preset content as the preset operation information; analyzing the log content of the row where the preset content is located to obtain the first IP address and the second IP address, wherein the first IP address is an IP address of a first server, the second IP address is a virtual service IP address, and the distributor performs preset operation on the first server.
According to an aspect of the embodiments of the present invention, there is also provided a monitoring method, including: receiving an analysis result sent by a cluster server, wherein the analysis result is obtained by analyzing a target log of the cluster server under the condition that preset content appears in the target log; performing one or more of the following operations according to the parsing result: updating data information in a CMDB database, sending a notification mail and recording a log.
Further, the parsing result includes preset operation information, a first IP address and a second IP address, where the first IP address is an IP address of a first server, the second IP address is a virtual service IP address, the distributor performs a preset operation on the first server, and updates data information in the CMDB database according to the parsing result, including: linking the CMDB database; retrieving a cluster record associated with the second IP address from the CMDB database; and adding or deleting the first IP address from the cluster record according to the preset operation information.
Further, the parsing result includes preset operation information, a first IP address and a second IP address, and recording a log according to the parsing result includes: filling the preset operation information, the first IP address and the second IP address into a first preset template to obtain a first log; and storing the first log in a local preset mounting catalog.
Further, the analyzing result includes preset operation information, a first IP address and a second IP address, and sending a notification mail according to the analyzing result includes: filling the preset operation information, the first IP address and the second IP address into a second preset template to obtain a notification mail; and sending the notification mail to a preset address.
According to an aspect of the embodiments of the present invention, there is also provided a monitoring apparatus, including: the system comprises a monitoring unit, a processing unit and a processing unit, wherein the monitoring unit is used for monitoring whether preset content appears in a target log, and the preset content is used for representing the operation of a distributor on a cluster server; the analysis unit is used for analyzing the target log under the condition that the preset content appears in the target log to obtain an analysis result; a sending unit, configured to send the parsing result to the distributor, so that the distributor performs one or more of the following operations according to the parsing result: updating data information in a CMDB database, sending a notification mail and recording a log.
Further, the parsing result includes preset operation information, a first IP address, and a second IP address, and the parsing unit includes: the storage subunit is used for storing the preset content as the preset operation information; and the analysis subunit is configured to analyze log content of a row where the preset content is located to obtain the first IP address and the second IP address, where the first IP address is an IP address of a first server, the second IP address is a virtual service IP address, and the distributor performs a preset operation on the first server.
According to an aspect of the embodiments of the present invention, there is also provided a monitoring apparatus, including: the device comprises a receiving unit and a processing unit, wherein the receiving unit is used for receiving an analysis result sent by a cluster server, and the analysis result is obtained by analyzing a target log of the cluster server under the condition that preset content appears in the target log; an execution unit, configured to execute one or more of the following operations according to the parsing result: updating data information in a CMDB database, sending a notification mail and recording a log.
Further, the parsing result includes preset operation information, a first IP address and a second IP address, where the first IP address is an IP address of a first server, the second IP address is a virtual service IP address, the distributor performs a preset operation on the first server, and the execution unit includes: a link subunit for linking the CMDB database; a retrieval subunit for retrieving a cluster record associated with the second IP address from the CMDB database; and the operation subunit is used for adding or deleting the first IP address from the cluster record according to the preset operation information.
According to an aspect of an embodiment of the present invention, there is also provided a storage medium including a stored program, wherein the program executes the monitoring method described above.
According to an aspect of the embodiment of the present invention, there is also provided a processor, configured to execute a program, where the program executes the monitoring method described above.
In the embodiment of the present invention, the preset content is used to indicate an operation performed by the distributor on the server, and when the preset content appears in the target log, the target log is parsed to obtain a parsing result, where the parsing result can indicate which server the distributor has performed the operation on, whether the distributor has performed an online operation or an offline operation, and the parsing result is sent to the distributor, and after receiving the parsing result, the distributor performs one or more of the following operations according to the parsing result: the technical effects of timely monitoring the online and offline conditions of the server are achieved by updating the data information in the CMDB database, sending the notification mail and recording the log, and the technical problem that the online and offline conditions of the server cannot be timely monitored in the prior art is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the invention and not to limit the invention. In the drawings:
FIG. 1 is a flow chart of an alternative monitoring method according to an embodiment of the invention;
FIG. 2 is a flow chart of yet another alternative monitoring method according to an embodiment of the present invention;
FIG. 3 is a flow chart of yet another alternative monitoring method according to an embodiment of the present invention;
FIG. 4 is a schematic view of an alternative monitoring device according to an embodiment of the present invention;
FIG. 5 is a schematic view of yet another alternative monitoring device according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In accordance with an embodiment of the present invention, there is provided an embodiment of a monitoring method, it should be noted that the steps illustrated in the flowchart of the accompanying drawings may be performed in a computer system such as a set of computer-executable instructions, and that while a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than here.
Example 1
Fig. 1 is a flow chart of an alternative monitoring method according to an embodiment of the invention. The method is performed by a cluster of servers. As shown in fig. 1, the method comprises the steps of:
step S102, whether preset content appears in the target log is monitored, wherein the preset content is used for representing the operation of the distributor on the cluster server.
And step S104, under the condition that the preset content appears in the target log, analyzing the target log to obtain an analysis result.
Step S106, sending the analysis result to the distributor so that the distributor can execute one or more of the following operations according to the analysis result: updating data information in a configuration management database CMDB, sending a notification mail and recording a log.
The preset content indicates that the distributor performs an online operation or an offline operation on the server. The preset content can be two types: content indicating that the distributor performs online operation on the cluster server; and the content represents that the distributor carries out offline operation on the cluster server.
If the preset content appears in the target log, the server is switched to be on-line or off-line by the distributor, the target log is analyzed, the server can be known to be operated by the distributor, the analysis result can indicate the server to be operated by the distributor, and the server is operated to be on-line or off-line.
After the analysis result is obtained, the analysis result is sent to the distributor. After the distributor receives the parsing result, the distributor can perform one or more of the following operations:
and the distributor updates the data information in the CMDB database according to the analysis result. The data information in the CMDB database may include cluster mapping relationships. And updating the cluster mapping relation according to the analysis result.
The distributor transmits a notification mail to a preset mail receiver according to the analysis result.
And the distributor records a log according to the analysis result, wherein the recorded log can indicate the online or offline action of the server at this time.
In the embodiment of the present invention, the preset content is used to indicate an operation performed by the distributor on the server, and when the preset content appears in the target log, the target log is parsed to obtain a parsing result, where the parsing result can indicate which server the distributor has performed the operation on, whether the distributor has performed an online operation or an offline operation, and the parsing result is sent to the distributor, and after receiving the parsing result, the distributor performs one or more of the following operations according to the parsing result: the method and the system have the advantages that data information in the CMDB database is updated, the notification mail is sent, and the log is recorded, so that the technical problem that the online and offline conditions of the server cannot be monitored in time in the prior art is solved, and the technical effect of monitoring the online and offline conditions of the server in time is achieved.
Optionally, the parsing result includes preset operation information, a first IP address, and a second IP address, and the parsing the target log to obtain a parsing result includes: storing the preset content as preset operation information; and analyzing a log of a row where the preset content is located to obtain a first IP address and a second IP address, wherein the first IP address is the IP address of the first server, the second IP address is the virtual service IP address, and the distributor performs preset operation on the first server.
The server which is online or offline by the distributor is the first server, and the preset operation is online operation or offline operation.
After the analysis result is obtained, the analysis result is sent to the distributor. After the distributor receives the parsing result, the distributor can perform one or more of the following operations:
and the distributor updates the data information in the CMDB database according to the analysis result. The data information in the CMDB database may include cluster mapping relationships. And updating the cluster mapping relation according to the analysis result. The distributor actively links the CMDB database, retrieves the corresponding cluster record through the second IP address, and adds the first IP address into the data record if the preset operation information indicates that the distributor carries out online operation on the first server; and if the preset operation information indicates that the distributor carries out offline operation on the first server, deleting the first IP address from the data record. Therefore, after the database is directly operated, the latest cluster mapping relation can be seen on the page of the CMDB.
The distributor transmits a notification mail to a preset mail receiver according to the analysis result. The notification mail carries the information of the preset operation and the first IP address, so that after a mail receiver receives the notification mail, the mail receiver can know whether the mail is subjected to online operation or offline operation according to the information of the preset operation, know which server the distributor performs the preset operation according to the first IP address, combine the information of the preset operation carried in the notification mail and the first IP address, know which server the distributor performs switching operation on, and know whether the mail is subjected to online operation or offline operation, thereby achieving the technical effect of monitoring the online and offline states of the servers in time.
The distributor records a log (first log described below) including whether the switching operation of the server is an online operation or an offline operation, based on the analysis result, and the distributor performs the switching operation on which server. The administrator can know the online and offline condition of the server by referring to the log.
The following examples illustrate:
and reading the cluster on/var/log/keepalive log file in real time, and monitoring whether the target log has the content of Adding (back end on line) or Removing (back end off line). The content including "Adding" and "moving" is the preset content.
If the preset content appears, the appearing content is stored as action, and for example, "Adding" or "moving", where "Adding" and "moving" are preset operation information. Then, the row log is analyzed, and an IP address (rs address rsip, i.e. first IP address) in the first [ ] number and an address (virtual service IP address vip, i.e. second IP address) in the second [ ] number are obtained and stored, and the log is exemplified as follows:
Removing service[10.200.40.161]:80from VS[121.52.220.89]:80
to summarize, three values are stored in the memory, respectively:
action: < addressing | removing > (Preset operation information)
Rxxx (first IP address)
Vip xxxx (second IP address)
Example 2
Fig. 2 is a flow chart of yet another alternative monitoring method according to an embodiment of the present invention. The method is performed by a distributor. As shown in fig. 2, the method comprises the steps of:
step S202, receiving an analysis result sent by the cluster server, wherein the analysis result is obtained by analyzing the target log of the cluster server under the condition that preset content appears in the target log.
Step S204, one or more of the following operations are executed according to the analysis result: updating data information in a CMDB database, sending a notification mail and recording a log.
The preset content indicates that the distributor performs an online operation or an offline operation on the server. The preset content can be two types: content indicating that the distributor performs online operation on the cluster server; and the content represents that the distributor carries out offline operation on the cluster server.
If the preset content appears in the target log, the server is switched to be on-line or off-line by the distributor, the target log is analyzed, the server can be known to be operated by the distributor, the analysis result can indicate the server to be operated by the distributor, and the server is operated to be on-line or off-line.
After the analysis result is obtained, the analysis result is sent to the distributor. After the distributor receives the parsing result, the distributor can perform one or more of the following operations:
and the distributor updates the data information in the CMDB database according to the analysis result. The data information in the CMDB database may include cluster mapping relationships. And updating the cluster mapping relation according to the analysis result.
The distributor transmits a notification mail to a preset mail receiver according to the analysis result.
And the distributor records a log according to the analysis result, wherein the recorded log can indicate the online or offline action of the server at this time.
In the embodiment of the present invention, the preset content is used to indicate an operation performed by the distributor on the server, and when the preset content appears in the target log, the target log is parsed to obtain a parsing result, where the parsing result can indicate which server the distributor has performed the operation on, whether the distributor has performed an online operation or an offline operation, and the parsing result is sent to the distributor, and after receiving the parsing result, the distributor performs one or more of the following operations according to the parsing result: the method and the system have the advantages that data information in the CMDB database is updated, the notification mail is sent, and the log is recorded, so that the technical problem that the online and offline conditions of the server cannot be monitored in time in the prior art is solved, and the technical effect of monitoring the online and offline conditions of the server in time is achieved.
Optionally, the parsing result includes preset operation information, a first IP address and a second IP address, the first IP address is an IP address of the first server, the second IP address is a virtual service IP address, the distributor performs the preset operation on the first server, and updates the data information in the CMDB database according to the parsing result, including: linking the CMDB database; retrieving the cluster record associated with the second IP address from the CMDB database; and adding or deleting the first IP address from the cluster record according to the preset operation information.
Optionally, the parsing result includes preset operation information, a first IP address, and a second IP address, and recording a log according to the parsing result includes: filling the preset operation information, the first IP address and the second IP address into a first preset template to obtain a first log; and storing the first log in a local preset mounting catalog.
The first log is stored in a local mounting directory which is a remote shared address, the modules are deployed on all distributors, and log paths are the remote shared address, so that cluster change logs of the whole network are stored in the same position and can be provided for personnel to perform unified analysis.
According to the scheme, the monitoring notification mechanism is placed at the distributor end, when the rs is at the back end of the distributor, the monitoring notification mechanism can send out mail notification, and rs changes can be updated into the CMDB system in real time, so that the cluster condition recorded in the CMDB is more accurate, and the change history can be stored for operation and maintenance personnel to perform decision analysis on the availability of the server.
Optionally, the parsing result includes preset operation information, a first IP address, and a second IP address, and sending a notification email according to the parsing result includes: filling the preset operation information, the first IP address and the second IP address into a second preset template to obtain a notification mail; and sending a notification mail to the preset address.
The server which is online or offline by the distributor is the first server, and the preset operation is online operation or offline operation.
After the analysis result is obtained, the analysis result is sent to the distributor. After the distributor receives the parsing result, the distributor can perform one or more of the following operations:
and the distributor updates the data information in the CMDB database according to the analysis result. The data information in the CMDB database may include cluster mapping relationships. And updating the cluster mapping relation according to the analysis result. The distributor actively links the CMDB database, retrieves the corresponding cluster record through the second IP address, and adds the first IP address into the data record if the preset operation information indicates that the distributor carries out online operation on the first server; and if the preset operation information indicates that the distributor carries out offline operation on the first server, deleting the first IP address from the data record. Therefore, after the database is directly operated, the latest cluster mapping relation can be seen on the page of the CMDB.
The distributor transmits a notification mail to a preset mail receiver according to the analysis result. The notification mail carries the information of the preset operation and the first IP address, so that after a mail receiver receives the notification mail, the mail receiver can know whether the mail is subjected to online operation or offline operation according to the information of the preset operation, know which server the distributor performs the preset operation according to the first IP address, combine the information of the preset operation carried in the notification mail and the first IP address, know which server the distributor performs switching operation on, and know whether the mail is subjected to online operation or offline operation, thereby achieving the technical effect of monitoring the online and offline states of the servers in time.
The distributor records a log (first log described below) including whether the switching operation of the server is an online operation or an offline operation, based on the analysis result, and the distributor performs the switching operation on which server. The administrator can know the online and offline condition of the server by referring to the log.
The following examples illustrate:
and reading the cluster on/var/log/keepalive log file in real time, and monitoring whether the target log has the content of Adding (back end on line) or Removing (back end off line). The content including "Adding" and "moving" is the preset content.
If the preset content appears, the appearing content is stored as action, and for example, "Adding" or "moving", where "Adding" and "moving" are preset operation information. Then, the row log is analyzed, and an IP address (rs address rsip, i.e. first IP address) in the first [ ] number and an address (virtual service IP address vip, i.e. second IP address) in the second [ ] number are obtained and stored, and the log is exemplified as follows:
Removing service[10.200.40.161]:80from VS[121.52.220.89]:80
to summarize, three values are stored in the memory, respectively:
action: < addressing | removing > (Preset operation information)
Rxxx (first IP address)
Vip xxxx (second IP address)
Example 3
The 4 modules included in the embodiment of the present invention are explained with reference to fig. 3.
Cluster log monitoring module
The module is deployed on a cluster, reads/var/log/keepalive log files in real time, monitors whether Adding (back end online) or Removing (back end offline) content occurs in logs, if so, stores the occurring content as action, such as Adding or Removing, analyzes the log to obtain an IP address (rs address rsip) in a first [ ] number and an address (virtual service IP address vip) in a second [ ] number, and sends a notification and data retrieval to the following three modules for use, wherein the log example is as follows:
Removing service[10.200.40.161]:80from VS[121.52.220.89]:80
to summarize, three values are stored in the memory, respectively:
Action:<adding|removing>
Rsip:xxxx
Vip:xxxx
these three values are finally passed simultaneously to the three modules below.
Mail notification module
The notification email is also deployed on the distributor, receives the three values transmitted by the module 1, writes the notification email according to a preset template, and transmits the notification email to an email receiver preset by a program, and the email receiver can be configured by self and is generally set as operation and maintenance personnel.
CMDB data updating module
And the same is deployed on a distributor, the three values transmitted by the module 1 are received, the CMDB database is actively linked, the corresponding cluster record is retrieved through the vip value, the value of the action variable is judged, if the action variable is adding, the record is changed, the rip is added into the data record, and if the action variable is removing, the record is changed, and the rip is deleted from the data record. Therefore, after the database is directly operated, the latest cluster mapping relation can be seen on the page of the CMDB.
Switching history recording module
The log is also deployed on the distributor, receives the three values transmitted by the module 1, and records the log of the online or offline action according to a preset recording template, wherein the number of the log is as follows:
[ 2017-03-0612: 00] Rsip xxxx shows a change in status in a cluster of vip xxxx: < action >
The log (the first log) is stored in a local mounting directory, the directory is a remote shared address, the modules are deployed on all the distributors, and the log paths are the remote shared addresses, so that the cluster change logs of the whole network are stored in the same position and can be provided for personnel to perform unified analysis.
According to the scheme, the monitoring notification mechanism is placed at the distributor end, when the rs is at the back end of the distributor, the monitoring notification mechanism can send out mail notification, and rs changes can be updated into the CMDB system in real time, so that the cluster condition recorded in the CMDB is more accurate, and the change history can be stored for operation and maintenance personnel to perform decision analysis on the availability of the server.
The method perfectly fills the function of notification/data recording/log recording switching in the up-and-down flow of rs in the keepalive + lvs load balancing cluster.
The monitoring method provided by the embodiment of the invention is a mechanism for informing Rs (Rs) switching on and off, and after Rs switching on and off, a CMDB (China Mobile database) system can update data information immediately, thereby achieving the technical effect of monitoring the switching state of a server in time.
Example 4
The embodiment of the invention also provides a monitoring device, which is positioned on the server cluster. The monitoring apparatus is used to perform the monitoring method in embodiment 1. Fig. 4 is a schematic diagram of an alternative monitoring device according to an embodiment of the present invention, as shown in fig. 4, the device comprising: monitoring unit 10, analysis unit 20, and transmission unit 30.
And a monitoring unit 10, configured to monitor whether preset content appears in the target log, where the preset content is used to indicate an operation performed on the server by the distributor.
And the analyzing unit 20 is configured to analyze the target log to obtain an analysis result when the preset content appears in the target log.
A sending unit 30, configured to send the parsing result to the distributor, so that the distributor performs one or more of the following operations according to the parsing result: updating data information in a CMDB database, sending a notification mail and recording a log.
Optionally, the parsing result includes preset operation information, a first IP address, and a second IP address, and the parsing unit 20 includes: a storage subunit and an analysis subunit. And the storage subunit is used for storing the preset content as the preset operation information. The analysis subunit is configured to analyze a log of a row where the preset content is located to obtain a first IP address and a second IP address, where the first IP address is an IP address of the first server, the second IP address is a virtual service IP address, and the distributor performs a preset operation on the first server.
The monitoring device comprises a processor and a memory, the monitoring unit 10, the analysis unit 20, the sending unit 30 and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to be one or more, and the online and offline conditions of the server are monitored by adjusting kernel parameters.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
An embodiment of the present invention provides a storage medium on which a program is stored, the program implementing the monitoring method when executed by a processor.
The embodiment of the invention provides a processor, which is used for running a program, wherein the monitoring method is executed when the program runs.
The embodiment of the invention provides equipment, which comprises a processor, a memory and a program which is stored on the memory and can run on the processor, wherein the processor executes the program and realizes the following steps:
monitoring whether preset content exists in a target log or not, wherein the preset content is used for representing the operation of a distributor on a server; under the condition that the preset content appears in the target log, analyzing the target log to obtain an analysis result; sending the parsing result to the distributor so that the distributor performs one or more of the following operations according to the parsing result: updating data information in a CMDB database, sending a notification mail and recording a log.
Storing the preset content as the preset operation information; analyzing a log of a row where the preset content is located to obtain the first IP address and the second IP address, wherein the first IP address is an IP address of a first server, the second IP address is a virtual service IP address, and the distributor performs preset operation on the first server.
The device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present application further provides a computer program product adapted to perform a program for initializing the following method steps when executed on a data processing device:
monitoring whether preset content exists in a target log or not, wherein the preset content is used for representing the operation of a distributor on a server; under the condition that the preset content appears in the target log, analyzing the target log to obtain an analysis result; sending the parsing result to the distributor so that the distributor performs one or more of the following operations according to the parsing result: updating data information in a CMDB database, sending a notification mail and recording a log.
Storing the preset content as the preset operation information; analyzing a log of a row where the preset content is located to obtain the first IP address and the second IP address, wherein the first IP address is an IP address of a first server, the second IP address is a virtual service IP address, and the distributor performs preset operation on the first server.
Example 5
The embodiment of the invention also provides a monitoring device, which is positioned on the distributor and used for executing the monitoring method in the embodiment 2. Fig. 5 is a schematic view of yet another alternative monitoring device according to an embodiment of the present invention, as shown in fig. 5, the device comprising: a receiving unit 40 and an executing unit 50.
The receiving unit 40 is configured to receive an analysis result sent by the cluster server, where the analysis result is obtained by analyzing a target log of the cluster server when a preset content appears in the target log.
An execution unit 50, configured to perform one or more of the following operations according to the parsing result: updating data information in a CMDB database, sending a notification mail and recording a log.
Optionally, the parsing result includes preset operation information, a first IP address, and a second IP address, and the execution unit 50 includes: a link subunit, a search subunit and an operation subunit. And the link subunit is used for linking the CMDB database. A retrieving subunit for retrieving the cluster record associated with the second IP address from the CMDB database. And the operation subunit is used for adding or deleting the first IP address from the cluster record according to the preset operation information. The first IP address is an IP address of the first server, the second IP address is a virtual service IP address, and the distributor performs preset operation on the first server.
The monitoring device comprises a processor and a memory, the receiving unit 40, the executing unit 50 and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to one or more than one, and the online and offline conditions of the server are monitored by adjusting kernel parameters.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
An embodiment of the present invention provides a storage medium on which a program is stored, the program implementing the monitoring method when executed by a processor.
The embodiment of the invention provides a processor, which is used for running a program, wherein the monitoring method is executed when the program runs.
The embodiment of the invention provides equipment, which comprises a processor, a memory and a program which is stored on the memory and can run on the processor, wherein the processor executes the program and realizes the following steps:
receiving an analysis result sent by a cluster server, wherein the analysis result is obtained by analyzing a target log of the cluster server under the condition that preset content appears in the target log; performing one or more of the following operations according to the parsing result: updating data information in a CMDB database, sending a notification mail and recording a log.
Linking the CMDB database; retrieving a cluster record associated with the second IP address from the CMDB database; and adding or deleting the first IP address from the cluster record according to the preset operation information. The first IP address is an IP address of the first server, the second IP address is a virtual service IP address, and the distributor performs preset operation on the first server.
Filling the preset operation information, the first IP address and the second IP address into a first preset template to obtain a first log; and storing the first log in a local preset mounting catalog.
Filling the preset operation information, the first IP address and the second IP address into a second preset template to obtain a notification mail; and sending the notification mail to a preset address.
The device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present application further provides a computer program product adapted to perform a program for initializing the following method steps when executed on a data processing device:
receiving an analysis result sent by a cluster server, wherein the analysis result is obtained by analyzing a target log of the cluster server under the condition that preset content appears in the target log; performing one or more of the following operations according to the parsing result: updating data information in a CMDB database, sending a notification mail and recording a log.
Linking the CMDB database; retrieving a cluster record associated with the second IP address from the CMDB database; and adding or deleting the first IP address from the cluster record according to the preset operation information. The first IP address is an IP address of the first server, the second IP address is a virtual service IP address, and the distributor performs preset operation on the first server.
Filling the preset operation information, the first IP address and the second IP address into a first preset template to obtain a first log; and storing the first log in a local preset mounting catalog.
Filling the preset operation information, the first IP address and the second IP address into a second preset template to obtain a notification mail; and sending the notification mail to a preset address.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (9)

1. A method of monitoring, comprising:
monitoring whether preset content exists in a target log or not, wherein the preset content is used for representing the operation of a distributor on a cluster server, and the operation comprises an online operation and an offline operation;
under the condition that the preset content appears in the target log, analyzing the target log to obtain an analysis result;
sending the parsing result to the distributor so that the distributor performs one or more of the following operations according to the parsing result: updating data information in a configuration management database CMDB, sending a notification mail and recording a log;
the distributor fills the preset operation information, the first IP address and the second IP address into a first preset template to obtain a first log, and stores the first log in a local preset mounting directory, wherein the preset mounting directory is a remote sharing address, the first IP address is an IP address of a first server, and the second IP address is a virtual service IP address.
2. The method of claim 1, wherein parsing the target log to obtain a parsed result comprises:
storing the preset content as the preset operation information;
and analyzing the log content of the row where the preset content is located to obtain the first IP address and the second IP address, wherein the distributor performs preset operation on the first server.
3. A method of monitoring, comprising:
receiving an analysis result sent by a cluster server, wherein the analysis result is obtained by analyzing a target log of the cluster server under the condition that preset content appears in the target log, the preset content is used for representing the operation of a distributor on the cluster server, and the operation comprises an online operation and an offline operation;
performing one or more of the following operations according to the parsing result: updating data information in a configuration management database CMDB, sending a notification mail and recording a log;
the analyzing result comprises preset operation information, a first IP address and a second IP address, and the recording of the log according to the analyzing result comprises the following steps: filling the preset operation information, the first IP address and the second IP address into a first preset template to obtain a first log; and storing the first log in a local preset mounting directory, wherein the preset mounting directory is a remote shared address, the first IP address is an IP address of a first server, and the second IP address is a virtual service IP address.
4. The method according to claim 3, wherein the distributor performs a predetermined operation on the first server, and updates the data information in the CMDB according to the parsing result, including:
linking the CMDB database;
retrieving a cluster record associated with the second IP address from the CMDB database;
and adding or deleting the first IP address from the cluster record according to the preset operation information.
5. The method of claim 3, wherein sending a notification mail according to the parsing result comprises:
filling the preset operation information, the first IP address and the second IP address into a second preset template to obtain a notification mail;
and sending the notification mail to a preset address.
6. A monitoring device, comprising:
the system comprises a monitoring unit, a processing unit and a processing unit, wherein the monitoring unit is used for monitoring whether preset content appears in a target log, the preset content is used for representing the operation of a distributor on a cluster server, and the operation comprises an online operation and an offline operation;
the analysis unit is used for analyzing the target log under the condition that the preset content appears in the target log to obtain an analysis result;
a sending unit, configured to send the parsing result to the distributor, so that the distributor performs one or more of the following operations according to the parsing result: updating data information in a configuration management database CMDB, sending a notification mail and recording a log;
the distributor fills the preset operation information, the first IP address and the second IP address into a first preset template to obtain a first log, and stores the first log in a local preset mounting directory, wherein the preset mounting directory is a remote sharing address, the first IP address is an IP address of a first server, and the second IP address is a virtual service IP address.
7. A monitoring device, comprising:
a receiving unit, configured to receive an analysis result sent by a cluster server, where the analysis result is obtained by analyzing a target log of the cluster server when a preset content appears in the target log, where the preset content is used to indicate an operation performed by a distributor on the cluster server, and the operation includes an online operation and an offline operation;
an execution unit, configured to execute one or more of the following operations according to the parsing result: updating data information in a configuration management database CMDB, sending a notification mail and recording a log;
the device is also used for filling the preset operation information, the first IP address and the second IP address into a first preset template to obtain a first log; and storing the first log in a local preset mounting directory, wherein the preset mounting directory is a remote shared address, the first IP address is an IP address of a first server, and the second IP address is a virtual service IP address.
8. A storage medium characterized by comprising a stored program, wherein the program executes the monitoring method of any one of claims 3 to 5.
9. A processor, characterized in that the processor is configured to run a program, wherein the program is configured to perform the monitoring method according to any one of claims 3 to 5 when running.
CN201710740576.5A 2017-08-24 2017-08-24 Monitoring method and device, storage medium and processor Active CN109428914B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710740576.5A CN109428914B (en) 2017-08-24 2017-08-24 Monitoring method and device, storage medium and processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710740576.5A CN109428914B (en) 2017-08-24 2017-08-24 Monitoring method and device, storage medium and processor

Publications (2)

Publication Number Publication Date
CN109428914A CN109428914A (en) 2019-03-05
CN109428914B true CN109428914B (en) 2022-01-25

Family

ID=65500829

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710740576.5A Active CN109428914B (en) 2017-08-24 2017-08-24 Monitoring method and device, storage medium and processor

Country Status (1)

Country Link
CN (1) CN109428914B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101707632A (en) * 2009-10-28 2010-05-12 浪潮电子信息产业股份有限公司 Method for dynamically monitoring performance of server cluster and alarming real-timely
CN103838867A (en) * 2014-03-20 2014-06-04 网宿科技股份有限公司 Log processing method and device
CN106777371A (en) * 2017-01-23 2017-05-31 北京齐尔布莱特科技有限公司 Result collection system and method
CN110754063A (en) * 2017-06-19 2020-02-04 思科技术公司 Verifying endpoint configuration between nodes

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150073613A1 (en) * 2013-09-10 2015-03-12 Max Chin Li Smart cloud service power outlet with surge protection and cloud service power consumption monitoring system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101707632A (en) * 2009-10-28 2010-05-12 浪潮电子信息产业股份有限公司 Method for dynamically monitoring performance of server cluster and alarming real-timely
CN103838867A (en) * 2014-03-20 2014-06-04 网宿科技股份有限公司 Log processing method and device
CN106777371A (en) * 2017-01-23 2017-05-31 北京齐尔布莱特科技有限公司 Result collection system and method
CN110754063A (en) * 2017-06-19 2020-02-04 思科技术公司 Verifying endpoint configuration between nodes

Also Published As

Publication number Publication date
CN109428914A (en) 2019-03-05

Similar Documents

Publication Publication Date Title
US9811435B2 (en) System for virtual machine risk monitoring
US10187249B2 (en) Distributed metric data time rollup in real-time
CN108696399B (en) Business service test method and device
US9535754B1 (en) Dynamic provisioning of computing resources
CN110309130A (en) A kind of method and device for host performance monitor
CN111258851B (en) Cluster alarm method, device, setting and storage medium
US20220116287A1 (en) Virtual network function bus-based auto-registration
CN103490941A (en) Real-time monitoring on-line configuration method in cloud computing environment
US10191800B2 (en) Metric payload ingestion and replay
US20180032906A1 (en) Adaptive Metric Pruning
CN111090440B (en) Information processing method, system, device and storage medium
CN110932933A (en) Network condition monitoring method, computing device and computer storage medium
CN108390907B (en) Management monitoring system and method based on Hadoop cluster
CN113595773B (en) Information processing method, device, electronic equipment and storage medium
CN105337748A (en) Log file collection method and system, server, and service cluster controlling apparatus
CN108337100B (en) Cloud platform monitoring method and device
CN111478792B (en) Cutover information processing method, system and device
CN109428914B (en) Monitoring method and device, storage medium and processor
CN109426559B (en) Command issuing method and device, storage medium and processor
CN114675931A (en) Resource monitoring method and monitoring device for integrated platform instance
CN111078975B (en) Multi-node incremental data acquisition system and acquisition method
CN110839066B (en) Data processing method and related equipment
US9240968B1 (en) Autogenerated email summarization process
CN114610567A (en) Container monitoring method, network device and storage medium
CN112433891A (en) Data processing method and device and server

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 100083 No. 401, 4th Floor, Haitai Building, 229 North Fourth Ring Road, Haidian District, Beijing

Applicant after: Beijing Guoshuang Technology Co.,Ltd.

Address before: 100086 Beijing city Haidian District Shuangyushu Area No. 76 Zhichun Road cuigongfandian 8 layer A

Applicant before: Beijing Guoshuang Technology Co.,Ltd.

GR01 Patent grant
GR01 Patent grant