Website real-time monitoring method, system, device and storage medium
By obtaining the website status code regularly and cumulative abnormal times, automatically notifying the abnormal handling terminal, the problem of delay in website monitoring and recovery and poor real-time notification in the existing technology is solved, real-time monitoring and timely alarm of the website are realized, and normal access to the website is ensured. .
Patent Information
- Application Number
- CN202011262138.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-12
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2040-11-12
AI Technical Summary
The existing website monitoring system has delayed recovery when it detects illegal deletion or tampering, poor real-time notifications, and a single method, which cannot meet the needs of quickly responding to website abnormalities.
By obtaining the website's web page status code regularly, judging abnormal situations, cumulative number of abnormalities, and automatically notifying the abnormality processing terminal when the threshold is reached, real-time monitoring and timely alarms are realized 24-hour all-weather and timely alarms.
Real-time monitoring and automatic alarm processing of the website are realized to ensure normal access to the website and avoid delayed reactions caused by human judgment.
Smart Images

Figure CN113791943B_ABST
Abstract
Description
Background Art
[0002] Most existing website monitoring systems use Web service call business logic to implement, and the results of successful and failed calls are reported to the monitoring server, and monitoring thresholds are set, and alarms are issued when the monitored parameters are lower than the monitoring thresholds. For example, for some important website services, the monitoring server of the website monitoring system sets the number of requests for monitoring. If the number of requests exceeds the monitoring threshold, or if the Web server does not report data to the monitoring server within the set time, an alarm is issued.
[0003] In the process of problem solving, operation and maintenance personnel need to rely on their development and operation and maintenance experience to manually judge when and through what operations the system may cause an alarm. Code needs to be embedded in the project to ensure that the website monitoring system can alarm normally, causing the system to be bloated. In addition, response strategies can only be taken when an alarm occurs, and the response time is relatively late.
[0004] The more mature technology for web page monitoring is timed monitoring, that is, the user sets the interval time, and the website monitoring system polls the web page files to be monitored on time to determine whether the files have been illegally deleted or tampered with. If found, the backup files on the backup disk are immediately used to restore them. This kind of monitoring has a defect: the web pages that have been illegally deleted or tampered with cannot be restored in time.
[0005] In addition, the existing website monitoring methods are relatively simple and generally notify through emails. When an alarm is needed, the operation and maintenance personnel are generally notified by email. The real-time performance of email notifications is poor, which may affect the timely resolution of alarm problems. In addition, the time spent on resolving alarm problems is completely determined by the developers and may not meet the needs. Summary of the invention
[0006] In view of the problems in the prior art, the purpose of the present invention is to provide a website real-time monitoring method, system, device and storage medium to monitor the website status in real time and promptly alarm when an abnormality occurs.
[0007] The embodiment of the present invention provides a method for real-time monitoring of a website, comprising the following steps:
[0008] Obtain and record the webpage status code of the monitored website at a preset interval;
[0009] Determine whether the currently acquired webpage status of the monitored website is abnormal according to the recorded webpage status code;
[0010] If it is a web page exception, the accumulated number of web page exceptions is increased by one, and it is determined whether the accumulated number of web page exceptions is greater than or equal to a first threshold;
[0011] If the accumulated number of web page anomalies is greater than or equal to the first threshold, it is determined that the website access has failed;
[0012] If the website access fails, determine whether an alarm is needed based on the number of website access failures;
[0013] If an alarm is required, a website access failure notification is sent to the exception handling terminal corresponding to the monitored website.
[0014] In some embodiments, after determining that the website access fails, the accumulated number of website access failures is increased by one, and judging whether an alarm is required based on the number of website access failures includes the following steps:
[0015] Determine whether the accumulated number of failed website accesses is greater than or equal to a second threshold;
[0016] If the accumulated number of failed website accesses is greater than or equal to the second threshold, it is determined that an alarm is currently required.
[0017] In some embodiments, after determining whether the currently acquired webpage status of the monitored website is abnormal, the following steps are further included:
[0018] If the web page is normal, the accumulated number of web page anomalies will be cleared to zero, and the accumulated number of website access failures will be cleared to zero.
[0019] In some embodiments, after determining whether the currently acquired webpage status of the monitored website is abnormal, the following steps are further included:
[0020] If the webpage is normal, determine whether the currently monitored website has an operation and maintenance task. If yes, send a website recovery notification to the exception handling terminal corresponding to the monitored website.
[0021] In some embodiments, if an alarm is required, the following steps are also included:
[0022] Determine whether the time difference between the time when the website access failure notification was last sent and the current time is greater than or equal to a third threshold, and whether the current time is within a preset operation and maintenance time range;
[0023] If yes, a website access failure notification is sent to the exception handling terminal corresponding to the monitored website.
[0024] In some embodiments, Prometheus is used to periodically obtain and record the webpage status code of the monitored website through the HTTP protocol.
[0025] In some embodiments, the step of obtaining the webpage status of the monitored website based on a preset interval comprises the following steps:
[0026] Discover monitored websites based on the specified website server, server TCP port or URL;
[0027] Get web page status from monitored websites regularly based on preset intervals.
[0028] In some embodiments, sending the website access failure notification to the exception handling terminal corresponding to the monitored website includes sending the website access failure notification to the exception handling terminal corresponding to the monitored website via a text message.
[0029] The embodiment of the present invention further provides a website real-time monitoring system, which is used to implement the website real-time monitoring method. The system includes:
[0030] A status acquisition module is used to periodically acquire and record the webpage status code of the monitored website based on a preset interval;
[0031] A failure judgment module is used to judge whether the currently acquired webpage status of the monitored website is a webpage abnormality according to the recorded webpage status code; if it is a webpage abnormality, the accumulated number of webpage abnormalities is increased by one, and it is judged whether the accumulated number of webpage abnormalities is greater than or equal to a first threshold; if the accumulated number of webpage abnormalities is greater than or equal to the first threshold, it is determined that the website access has failed;
[0032] An alarm judgment module is used to judge whether an alarm is needed according to the number of website access failures if the website access fails;
[0033] The failure notification module is used to send a website access failure notification to the exception handling terminal corresponding to the monitored website if an alarm is required.
[0034] The embodiment of the present invention further provides a website real-time monitoring device, comprising:
[0035] processor;
[0036] a memory storing executable instructions of the processor;
[0037] Wherein, the processor is configured to execute the steps of the website real-time monitoring method by executing the executable instructions.
[0038] The embodiment of the present invention also provides a computer-readable storage medium for storing a program, and the program, when executed, implements the steps of the method for real-time monitoring of a website.
[0039] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure.
[0040] The website real-time monitoring method, system, device and storage medium of the present invention have the following beneficial effects:
[0041] The present invention obtains and monitors the website status in real time, automatically determines whether the website is running normally, and automatically notifies the exception handling terminal for timely processing when an access failure occurs and the number of failures reaches a certain number. It can realize 24-hour real-time monitoring and timely alarm processing of the website to ensure normal access to the website. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Other features, objectives and advantages of the present invention will become more apparent from a reading of the detailed description of non-limiting embodiments made with reference to the following accompanying drawings.
[0043] Figure 1 is a flow chart of a website real-time monitoring method according to an embodiment of the present invention;
[0044] Figure 2 is a detailed flow chart of determining whether an alarm is required according to an embodiment of the present invention;
[0045] Figure 3 It is a structural diagram of a website real-time monitoring system according to an embodiment of the present invention;
[0046] Figure 4 It is a structural diagram of a website real-time monitoring device according to an embodiment of the present invention;
[0047] Figure 5 It is a schematic diagram of the structure of a computer-readable storage medium according to an embodiment of the present invention. DETAILED DESCRIPTION
[0048] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0049] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0050] like Figure 1 As shown, an embodiment of the present invention provides a method for real-time monitoring of a website, comprising the following steps:
[0051] S100: obtaining and recording the webpage status code of the monitored website at a preset interval;
[0052] S200: judging whether the currently acquired webpage status of the monitored website is abnormal according to the recorded webpage status code, for example, when the status code of the webpage status is 200, the webpage status is normal, if the status code of the webpage status is other values, the webpage is abnormal, for example, when the status code is 504, it indicates that the server is abnormal, when the status code is 404, it indicates that the static resource is abnormal, etc.;
[0053] S300: If the webpage is abnormal, the accumulated number of webpage anomalies is increased by one, and it is determined whether the accumulated number of webpage anomalies is greater than or equal to a first threshold; the value of the first threshold here can be set as needed, for example, set to 5, but the present invention is not limited thereto. In other implementations, the first threshold can also be set to 3, 4, 6, etc., all of which are within the protection scope of the present invention;
[0054] S400: If the accumulated number of web page anomalies is greater than or equal to the first threshold, it is determined that the website access has failed.
[0055] S500: If the website access fails, determine whether an alarm is required based on the number of website access failures;
[0056] S600: If an alarm is required, a website access failure notification is sent to the exception handling terminal corresponding to the monitored website.
[0057] Here, the exception handling terminal may be an operation and maintenance personnel terminal associated with the monitored website. When it is necessary to send a website access failure notification to the exception handling terminal corresponding to the monitored website, the mapping table of the website and the operation and maintenance personnel communication information may be queried first, the operation and maintenance personnel communication information of the monitored website may be obtained, and the website access failure notification may be sent to the operation and maintenance personnel terminal corresponding to the operation and maintenance personnel communication information. The operation and maintenance personnel terminal here may be a mobile phone, tablet computer, laptop computer, etc. used by the operation and maintenance personnel to receive messages. Correspondingly, the operation and maintenance personnel communication information may include a mobile phone number, an email address, etc. When sending a website access failure notification, it may be sent via SMS or email. Among them, SMS may have better real-time performance than email, which is convenient for operation and maintenance personnel to find and handle problems in the first place.
[0058] The present invention obtains and monitors the website status in real time through step S100, wherein the length of the preset interval time can be selected and set as needed. When it is set to a smaller value, the intensity of website monitoring can be strengthened. Whether the website operation is normal is automatically determined through steps S200 to S500, and when an access failure occurs and the number of failures reaches a certain number, the abnormal processing terminal is automatically notified through step S600 for timely processing, which can realize 24-hour real-time monitoring of the website and timely alarm processing to ensure normal access to the website.
[0059] In this embodiment, in step S100, Prometheus is used to periodically obtain and record the webpage status code of the monitored website through the HTTP protocol. The monitoring cycle can be set, for example, setting the scheduling to start every five minutes.
[0060] In this embodiment, the step of obtaining the webpage status of the monitored website based on a preset interval time period includes the following steps:
[0061] Discover monitored websites based on the specified website server, server TCP port or URL;
[0062] Get the webpage status code from the monitored website regularly based on the preset interval time.
[0063] Prometheus is an open source monitoring alarm system and time series database developed by SoundCloud. The basic principle of Prometheus is to periodically capture the status of monitored components through the HTTP (HyperText Transfer Protocol) protocol. Any component can access the monitoring status as long as it provides the corresponding HTTP interface. No SDK (Software Development Kit) or other integration process is required. Compared with the existing technology, there is no need to integrate a large amount of code in the website monitoring system to avoid system bloat. This is very suitable for virtualized environment monitoring systems, such as vm docker k8s, etc. The HTTP interface that outputs the monitored component information is called exporter. At present, most of the components commonly used by Internet companies have exporters that can be used directly, such as vmrnish, haproxy, nginx, mysql, and linux system information (including disk, memory, CPU, network, etc.).
[0064] When using Prometheus to monitor website status, Prometheusdaemon is responsible for periodically fetching metrics data from the target. Each target needs to expose an HTTP service interface to be periodically fetched. Prometheus supports specifying fetch targets through configuration files, text files, zookeeper, consul, dns srv lookup, etc. Prometheus uses a pull method for monitoring, that is, the server can pull data directly through the target or push data indirectly through an intermediate gateway.
[0065] Prometheus stores all captured data locally, cleans and organizes the data according to certain rules, and stores the results in a new time series.
[0066] Prometheus uses promql and other APIs to visualize the collected data. Prometheus supports many ways of icon visualization, such as grafana, built-in Prometheus, and its own template engine. Prometheus can provide HTTP API (Application Programming Interface) query methods and customize the required output. Pushgateway supports the client to actively push metrics to the pushgateway, while Prometheus only crawls data from the gateway at regular intervals. Aletmanager is a component independent of Prometheus that can support Prometheus query statements and provide a very flexible alarm method.
[0067] like Figure 2 As shown, after step S300, if the accumulated number of web page anomalies is less than the first threshold, there is no need to increase the accumulated number of website access failures by one, and the process returns to step S100 to continue scanning and monitoring at the next moment.
[0068] like Figure 2 As shown, in this embodiment, the step S400: after determining that the website access fails, the accumulated number of website access failures is increased by one, and the step S500: judging whether an alarm is required according to the number of website access failures, includes the following steps:
[0069] S510: Determine whether the accumulated number of failed website accesses is greater than or equal to a second threshold value. The value of the second threshold value can be set as needed, for example, 2, but the present invention is not limited thereto. In other implementations, the second threshold value can also be set to values such as 3, 4, 5, etc., all of which are within the protection scope of the present invention. In addition, the second threshold value can also be set to 1, that is, an alarm is triggered when a website access failure is detected.
[0070] If the accumulated number of failed website accesses is greater than or equal to the second threshold, it is determined that an alarm is currently required, and the process continues to step S600;
[0071] If the accumulated number of failed website accesses is less than the second threshold, the recorded website information is updated, and then the scanning and monitoring of the next website is continued.
[0072] In this embodiment, further, after the step S200: determining whether the currently acquired webpage status of the monitored website is abnormal, the following steps are further included:
[0073] If the web page is normal, the accumulated number of web page anomalies will be cleared to zero, and the accumulated number of website access failures will be cleared to zero, without affecting the monitoring of the next website anomaly and website access failure.
[0074] In this embodiment, after the step S200: determining whether the currently acquired webpage status of the monitored website is abnormal, the following steps are further included:
[0075] If the webpage is normal, determine whether the currently monitored website has an operation and maintenance task. If so, send a website recovery notification to the exception handling terminal.
[0076] like Figure 2 As shown, specifically, it is determined whether the currently monitored website has an operation and maintenance task, that is, it is determined whether the number of website access failures is greater than or equal to the second threshold before the number of website access failures is cleared. If so, it means that a website access failure notification has been sent to the exception handling terminal before, that is, there is an operation and maintenance task. At this time, it is necessary to send a website recovery notification to the exception handling terminal to provide operation and maintenance results feedback to the exception handling terminal.
[0077] In this embodiment, if an alarm is required, the following steps are also included:
[0078] Determine whether the time difference between the time when the website access failure notification was last sent and the current time is greater than or equal to a third threshold, and whether the current time is within a preset operation and maintenance time range;
[0079] If yes, a website access failure notification is sent to the exception handling terminal corresponding to the monitored website.
[0080] In this embodiment, sending the website access failure notification to the exception handling terminal corresponding to the monitored website includes sending the website access failure notification to the exception handling terminal corresponding to the monitored website via SMS. The exception handling terminal may also receive other information related to website monitoring.
[0081] like Figure 3 As shown, the embodiment of the present invention further provides a website real-time monitoring system, which is used to implement the website real-time monitoring method, and the system includes:
[0082] The status acquisition module M100 is used to periodically acquire and record the webpage status code of the monitored website based on a preset interval;
[0083] The failure judgment module M200 is used to judge whether the website access fails according to the recorded webpage status;
[0084] The alarm judgment module M300 is used to judge whether an alarm is needed according to the number of website access failures if the website access fails;
[0085] The failure notification module M400 is used to send a website access failure notification to the exception handling terminal corresponding to the monitored website if an alarm is required.
[0086] In the website real-time monitoring system of the present invention, the functions of each module can be implemented by the specific implementation of the website real-time monitoring method described above. For example, the status acquisition module M100 can adopt the specific implementation of the above step S100 to obtain the website status and records, the failure judgment module M200 judges the failure of network access through the specific implementation of the above steps S200 to S400, the alarm judgment module M300 judges whether an alarm is needed through the specific implementation of step S500, and the failure notification module M400 timely notifies the operation and maintenance personnel when an alarm is needed through the specific implementation of step S600.
[0087] The present invention acquires and monitors the website status in real time through the status acquisition module M100, automatically determines whether the website runs normally through the failure judgment module M200 and the alarm judgment module M300, and automatically notifies the abnormal processing terminal for timely processing through the failure notification module M400 when an access failure occurs and the number of failures reaches a certain number, thereby realizing 24-hour real-time monitoring and timely alarm processing of the website, and ensuring normal access to the website.
[0088] Specifically, the failure judgment module M200 can judge whether the webpage status of the monitored website currently acquired is a webpage abnormality according to the webpage status code, for example, when the status code of the webpage status is 200, the webpage status is normal, if the status code of the webpage status is other values, the webpage is abnormal, for example, when the status code is 504, it indicates a server abnormality, when the status code is 404, it indicates a static resource abnormality, etc.; if it is a webpage abnormality, the failure judgment module M200 will increase the accumulated number of webpage abnormalities by one, and the failure judgment module M200 will judge whether the accumulated number of webpage abnormalities is greater than or equal to a first threshold value, where the value of the first threshold value can be set as needed, for example, set to 5, but the present invention is not limited thereto, in other implementations, the first threshold value can also be set to 3, 4, 6, etc., all of which belong to the protection scope of the present invention. If the accumulated number of webpage abnormalities is greater than or equal to the first threshold value, the failure judgment module M200 determines that the website access has failed, and increases the accumulated number of website access failures by one; if the accumulated number of webpage abnormalities is less than the first threshold value, the failure judgment module M200 does not need to increase the accumulated number of website access failures by one.
[0089] Specifically, the alarm judgment module M300 judges whether an alarm is needed based on the number of website access failures, including: the alarm judgment module M300 judges whether the cumulative number of website access failures is greater than or equal to a second threshold; if the cumulative number of website access failures is greater than or equal to the second threshold, the alarm judgment module M300 determines that an alarm is currently needed, and the failure notification module M400 issues an alarm; if the cumulative number of website access failures is less than the second threshold, the alarm judgment module M300 updates the recorded website information.
[0090] Furthermore, the alarm judgment module M300 is also used to judge whether the currently monitored website has an operation and maintenance task if the webpage is normal, and if so, send a website recovery notification to the exception handling terminal.
[0091] Furthermore, the failure notification module M400 sends the website access failure notification to the exception handling terminal corresponding to the monitored website, including sending the website access failure notification to the exception handling terminal corresponding to the monitored website via SMS.
[0092] An embodiment of the present invention also provides a real-time website monitoring device, comprising a processor; a memory, in which executable instructions of the processor are stored; wherein the processor is configured to execute the steps of the real-time website monitoring method by executing the executable instructions.
[0093] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as systems, methods or program products. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, which may be collectively referred to herein as "circuits", "modules" or "platforms".
[0094] Refer to the following Figure 4 The electronic device 600 according to this embodiment of the present invention is described. Figure 4 The electronic device 600 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0095] like Figure 4 As shown, the electronic device 600 is in the form of a general computing device. The components of the electronic device 600 may include, but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus 630 connecting different system components (including the storage unit 620 and the processing unit 610), a display unit 640, etc.
[0096] The storage unit stores program codes, which can be executed by the processing unit 610, so that the processing unit 610 executes the steps of various exemplary embodiments of the present invention described in the above-mentioned website real-time monitoring method section of this specification. For example, the processing unit 610 can execute the following steps: Figure 1 Follow the steps shown in .
[0097] The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 6201 and / or a cache memory unit 6202 , and may further include a read-only memory unit (ROM) 6203 .
[0098] The storage unit 620 may also include a program / utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include the implementation of a network environment.
[0099] Bus 630 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0100] The electronic device 600 may also communicate with one or more external devices 700 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 600, and / or communicate with any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 650. Furthermore, the electronic device 600 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 660. The network adapter 660 may communicate with other modules of the electronic device 600 via a bus 630. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0101] The embodiment of the present invention further provides a computer-readable storage medium for storing a program, which implements the steps of the website real-time monitoring method when executed. In some possible implementations, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code, and when the program product is executed on a terminal device, the program code is used to cause the terminal device to execute the steps of various exemplary embodiments of the present invention described in the above website real-time monitoring method section of this specification.
[0102] refer to Figure 5 As shown, a program product 800 for implementing the above method according to an embodiment of the present invention is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be executed on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0103] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0104] The computer readable storage medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by an instruction execution system, an apparatus, or a device or used in combination with it. The program code contained on the readable storage medium may be transmitted with any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.
[0105] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0106] In summary, by adopting the website real-time monitoring method, system, equipment and storage medium of the present invention, by acquiring and monitoring the website status in real time, it is automatically determined whether the website is running normally, and when an access failure occurs and the number of failures reaches a certain number, the exception handling terminal is automatically notified for timely processing. This can achieve 24-hour real-time monitoring of the website and timely alarm processing to ensure normal access to the website.
[0107] The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as falling within the protection scope of the present invention.
Claims
1. A method for real-time monitoring of a website, characterized in that: include: Obtain and record the webpage status code of the monitored website at a preset interval; Determine whether the currently acquired webpage status of the monitored website is abnormal according to the recorded webpage status code; If it is a web page exception, the accumulated number of web page exceptions is increased by one, and it is determined whether the accumulated number of web page exceptions is greater than or equal to a first threshold; If the accumulated number of web page anomalies is greater than or equal to the first threshold, it is determined that the website access has failed; If the website access fails, determine whether an alarm is needed based on the number of website access failures; If an alarm is required, a website access failure notification is sent to the exception handling terminal corresponding to the monitored website; After determining that the website access fails, the accumulated number of website access failures is increased by one, and judging whether an alarm is required according to the number of website access failures includes the following steps: Determine whether the accumulated number of failed website accesses is greater than or equal to a second threshold; If the accumulated number of failed website accesses is greater than or equal to the second threshold, it is determined that an alarm is currently required; If the accumulated number of failed website accesses is less than the second threshold, the recorded website information is updated, and then the scanning and monitoring of the next website is continued; Wherein, after determining whether the currently acquired webpage status of the monitored website is abnormal, the following steps are further included: If the webpage is normal, determine whether the currently monitored website has an operation and maintenance task, and if so, send a website recovery notification to the exception handling terminal corresponding to the monitored website; The step of determining whether the currently monitored website has an operation and maintenance task includes: Determining whether the number of website access failures is greater than or equal to a second threshold before the number of website access failures is cleared, and if so, determining that there is an operation and maintenance task in the monitored website; If an alarm is required, the following steps are also included: Determine whether the time difference between the time when the website access failure notification was last sent and the current time is greater than or equal to a third threshold, and whether the current time is within a preset operation and maintenance time range; If yes, a website access failure notification is sent to the exception handling terminal corresponding to the monitored website.
2. The website real-time monitoring method according to claim 1, characterized in that: After determining whether the currently acquired webpage status of the monitored website is abnormal, the following steps are also included: If the web page is normal, the accumulated number of web page anomalies will be cleared to zero, and the accumulated number of website access failures will be cleared to zero.
3. The website real-time monitoring method according to claim 1, characterized in that: Prometheus is used to periodically obtain and record the webpage status code of the monitored website through the HTTP protocol.
4. The website real-time monitoring method according to claim 1, characterized in that: The method of regularly obtaining the webpage status of the monitored website based on a preset interval time includes the following steps: Discover monitored websites based on the specified website server, server TCP port or URL; Get web page status from monitored websites regularly based on preset intervals.
5. The website real-time monitoring method according to claim 1, characterized in that: The sending of the website access failure notification to the exception handling terminal corresponding to the monitored website includes sending the website access failure notification to the exception handling terminal corresponding to the monitored website via a text message.
6. A website real-time monitoring system, used to implement the website real-time monitoring method according to any one of claims 1 to 5, characterized in that: The system comprises: A status acquisition module is used to periodically acquire and record the webpage status code of the monitored website based on a preset interval; A failure judgment module is used to judge whether the currently acquired webpage status of the monitored website is a webpage abnormality according to the recorded webpage status code; if it is a webpage abnormality, the accumulated number of webpage abnormalities is increased by one, and it is judged whether the accumulated number of webpage abnormalities is greater than or equal to a first threshold; if the accumulated number of webpage abnormalities is greater than or equal to the first threshold, it is determined that the website access has failed; An alarm judgment module is used to judge whether an alarm is needed according to the number of website access failures if the website access fails; A failure notification module is used to send a website access failure notification to the exception handling terminal corresponding to the monitored website if an alarm is required; After determining that the website access fails, the accumulated number of website access failures is increased by one, and judging whether an alarm is required according to the number of website access failures includes the following steps: Determine whether the accumulated number of failed website accesses is greater than or equal to a second threshold; If the accumulated number of failed website accesses is greater than or equal to the second threshold, it is determined that an alarm is currently required; If the accumulated number of failed website accesses is less than the second threshold, the recorded website information is updated, and then the scanning and monitoring of the next website is continued; Wherein, after determining whether the currently acquired webpage status of the monitored website is abnormal, the following steps are further included: If the webpage is normal, determine whether the currently monitored website has an operation and maintenance task, and if so, send a website recovery notification to the exception handling terminal corresponding to the monitored website; The step of determining whether the currently monitored website has an operation and maintenance task includes: Determining whether the number of website access failures is greater than or equal to a second threshold before the number of website access failures is cleared, and if so, determining that there is an operation and maintenance task in the monitored website; If an alarm is required, the following steps are also included: Determine whether the time difference between the time when the website access failure notification was last sent and the current time is greater than or equal to a third threshold, and whether the current time is within a preset operation and maintenance time range; If yes, a website access failure notification is sent to the exception handling terminal corresponding to the monitored website.
7. A website real-time monitoring device, characterized in that: include: processor; a memory storing executable instructions of the processor; The processor is configured to execute the steps of the website real-time monitoring method according to any one of claims 1 to 5 by executing the executable instructions.
8. A computer-readable storage medium for storing a program, characterized in that: When the program is executed, the steps of the website real-time monitoring method described in any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Method for detecting unknown abnormal behaviors of website
CN107438079A
24-hour distributed website performance monitoring and real-time alarm method
CN107888452A
Control method, device and equipment of data acquisition task
CN108009295A
Website access abnormality monitoring method, device and medium
CN108471359A
Website usability alarm method and system based on web log
CN109347665A
