Disclosure of Invention
The application aims to provide a method, a device and a system for detecting the usability of a web system, which are used for solving the problem that the existing web system usability detection scheme only detects the web system and lacks objectivity and reliability. The specific scheme is as follows:
in a first aspect, the present application provides a method for detecting availability of a web system, including:
acquiring configuration parameters of an availability detection task for a web system;
generating a configuration file according to the configuration parameters, and sending the configuration file to a detection engine;
determining a URL, an IP address and a DNS server address in the configuration file by using the detection engine, and respectively initiating an access request to the URL, the IP address and the DNS server address to obtain detection data, wherein the detection data comprises a DNS analysis state, an HTTP response code, URL request response time and IP request response time;
and generating alarm information when the detection data meets an alarm triggering condition.
Preferably, the sending the configuration file to a detection engine includes:
and sending the configuration file to a detection engine every preset time length or when the change times of the configuration file reach preset times so as to synchronize the configuration file.
Preferably, the generating alarm information when the detection data meets an alarm triggering condition includes:
judging whether the detection data meet a normal service condition, wherein the normal service condition is as follows: the code value of the HTTP response code is within a first range and the URL request response time is within a second range;
if so, determining that the web system service is normal;
otherwise, judging that the detection data meets the alarm triggering condition and generating alarm information.
Preferably, when the detection data meets an alarm triggering condition, generating alarm information includes:
judging whether the detection data meet abnormal service conditions or fault conditions; the service exception condition is as follows: the code value of the HTTP response code is within the first range, the URL request response time is not within the first range and the IP request response time is within the first range, or the code value of the HTTP response code is within a third range; the fault conditions are: the code value of the HTTP response code is in a fourth range, or the HTTP response code is not received, or the DNS analysis state is failure;
and if so, judging that the detection data meets the alarm triggering condition and generating alarm information.
Preferably, the generating alarm information when the detection data meets an alarm triggering condition includes:
and if the proportion of the detection data meeting the alarm triggering condition in the detection data of the multiple access requests reaches a preset proportion, generating alarm information.
Preferably, the generating alarm information when the detection data meets an alarm triggering condition includes:
and generating an alarm parameter according to the detection data, and generating corresponding alarm information according to the alarm parameter by using an alarm module.
Preferably, the detecting data further includes a web page title, and the generating of the alarm information when the detecting data meets the alarm triggering condition includes:
judging whether the web page titles in the detection data of the multiple access requests are the same or not;
and if the detection data are different, judging that the detection data meet the alarm triggering condition, and generating alarm information.
In a second aspect, the present application provides an availability detecting apparatus for a web system, including:
a configuration module: the method comprises the steps of obtaining configuration parameters of an availability detection task for the web system;
a file sending module: the system comprises a configuration engine, a detection engine and a data processing module, wherein the configuration engine is used for generating a configuration file according to the configuration parameters and sending the configuration file to the detection engine;
a detection module: the detection engine is used for determining a URL, an IP address and a DNS server address in the configuration file, and respectively initiating an access request to the URL, the IP address and the DNS server address to obtain detection data, wherein the detection data comprises a DNS analysis state, an HTTP response code, URL request response time and IP request response time;
an alarm module: and the alarm information generating unit is used for generating alarm information when the detection data meet alarm triggering conditions.
In a third aspect, the present application provides an availability detection system for a web system, comprising: the system comprises a management center, a center machine, a detection engine, data analysis equipment and an alarm;
the management center is used for acquiring configuration parameters of an availability detection task for the web system;
the central machine is used for generating a configuration file according to the configuration parameters and sending the configuration file to the detection engine;
the detection engine is used for determining a URL, an IP address and a DNS server address in the configuration file, and respectively initiating an access request to the URL, the IP address and the DNS server address to obtain detection data, wherein the detection data comprises a DNS analysis state, an HTTP response code, URL request response time and IP request response time;
the data analysis equipment is used for judging whether the detection data meet an alarm triggering condition;
the alarm is used for generating alarm information when the detection data meets alarm triggering conditions.
The application provides a method for detecting the availability of a web system, which comprises the following steps: acquiring configuration parameters of an availability detection task for a web system; generating a configuration file according to the configuration parameters, and sending the configuration file to a detection engine; determining a URL (uniform resource locator), an IP (Internet protocol) address and a DNS (domain name server) address in a configuration file by using a detection engine, and respectively initiating access requests to the URL, the IP address and the DNS address to obtain detection data, wherein the detection data comprises a DNS analysis state, an HTTP response code, URL request response time and IP request response time; and when the detection data meet the alarm triggering condition, generating alarm information.
In the Internet, the access quality of a web system is influenced by domain name resolution, the network performance and the performance of a web server, and a traditional availability detection scheme only accesses a URL of the web system.
In addition, the application also provides a device and a system for detecting the usability of the web system, and the technical effect of the device and the system corresponds to that of the method, and the details are not repeated here.
Detailed Description
The core of the application is to provide a method, a device and a system for detecting the availability of a web system, so that the purpose of detecting the availability of the web system from multiple dimensions such as domain name resolution, network connectivity, a web server and the like is achieved, the objectivity of the availability detection is ensured, and the reliability of the availability detection is improved.
In order that those skilled in the art will better understand the disclosure, the following detailed description will be given with reference to the accompanying drawings. It is to be understood that the embodiments described are only a few embodiments of the present application and not all 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 application.
Referring to fig. 1, a first embodiment of a method for detecting availability of a web system provided in the present application is described below, where the first embodiment includes:
s101, acquiring configuration parameters of an availability detection task for a web system;
the web system is implemented based on the HTTP protocol, and to detect whether the web system is available, the current scheme is to access the URL of the web system and determine whether the web system is available according to whether the response information is normal. When the availability of the web system is detected, the embodiment initiates an access request not only to the URL of the web system, but also to the IP address of the web system and the DNS server address of the web system, so that the purpose of detecting the availability of the web system from the dimensions of domain name resolution and network connectivity is achieved, and the detection of the availability of the server bearing the web system can be completed.
In this embodiment, before performing availability detection, first, configuration parameters of an availability detection task for a web system are obtained, where the configuration parameters include a URL of the web system, an IP address of the web system, and a DNS server address of the web system, and may further include information such as a request timeout duration and an alarm parameter. Preferably, the DNS server address may specifically include an authoritative DNS server address and a recursive DNS server address.
As a specific implementation manner, on the management center side, according to a user operation, the configuration parameters of the usability detection task for the web system are generated.
S102, generating a configuration file according to the configuration parameters, and sending the configuration file to a detection engine;
in a specific embodiment, at the central machine side, the configuration parameters are written into a configuration file, and the configuration file is sent to detection engines distributed in various regions. As a preferred embodiment, in order to ensure that the configuration files on the central machine and the detection engine are synchronized, a synchronization module may be disposed on the central machine and the detection engine, where the synchronization module on the central machine is configured to detect whether the local configuration file is synchronized with the configuration file on the detection engine, and send a synchronization instruction to the synchronization module on the detection engine when the local configuration file is not synchronized with the configuration file on the detection engine, so as to implement synchronization of the configuration files. On this basis, in order to avoid frequent synchronization, the trigger condition of synchronization may be set as: and every other preset time length, or the change times of the configuration file reach preset times.
S103, determining a URL, an IP address and a DNS server address in the configuration file by using the detection engine, and respectively initiating access requests to the URL, the IP address and the DNS server address to obtain detection data;
in this embodiment, the detection data includes a DNS resolution status, an HTTP response code, URL request response time, and IP request response time. It can be understood that there is a mutual constraint relationship between the above information, for example, when the URL request normally responds (the response time of the URL request is less than the threshold), the DNS resolution status is resolution success; the response time of the URL request is greater than the response time of the IP request. In addition, the present embodiment defaults to the HTTP response code of the URL request and the HTTP response code of the IP request.
And S104, generating alarm information when the detection data meet the alarm triggering condition.
As a specific manner, the states of the web system may be divided into three types, that is, normal service, abnormal service, and failure, and the determination condition of each state is preset, and when the detection data meets the determination condition of abnormal service or failure, the detection data is considered to meet the alarm triggering condition, and alarm information is generated.
As a preferred implementation manner, the corresponding alarm parameters may be generated according to the detection data, and the alarm module may send out corresponding alarm information according to the alarm parameters. In this way, more information can be embodied in the alarm information, for example, whether the state of the web system is abnormal or fault is embodied, so that more information is provided for operation and maintenance personnel.
In addition, in order to ensure the reliability of the availability detection, the detection data of multiple access requests can be obtained through multiple accesses, whether the detection data of each access request meets the alarm triggering condition or not is respectively judged, and the alarm information is generated only when the proportion between the detection data meeting the alarm triggering condition and the detection data of the multiple access requests reaches a preset proportion.
According to the method for detecting the availability of the web system, the URL, the IP address and the DNS address of the web system are respectively accessed in the process of detecting the availability of the web system, so that the purpose of respectively detecting the availability of the web system from multiple dimensions such as domain name resolution, network connectivity, the web server and the like is realized, the objectivity of availability detection is ensured, and the reliability of the availability detection is improved.
An embodiment of a method for detecting availability of a web system provided by the present application is described in detail below, and the embodiment two is implemented based on the foregoing embodiment one and is expanded to a certain extent on the basis of the embodiment one.
Before the implementation flow of the second embodiment is introduced, the system components corresponding to the second embodiment will be described:
establishing a management center for establishing, releasing, editing, deleting and other working states of the usability detection task;
establishing a central machine for generating a configuration file according to the configuration parameters of the availability detection tasks issued by the management center and sending the configuration file to each detection engine, wherein the central machine and the detection engines respectively comprise a synchronization module for monitoring whether the configuration files of each detection engine are synchronized with the central machine;
establishing a plurality of detection engines in a plurality of regions respectively, wherein the detection engines are provided with an HTTP response code acquisition module, a page title acquisition module, a DNS analysis state acquisition module and a synchronization module;
and establishing data analysis equipment and alarm equipment.
Referring to fig. 2, the second embodiment specifically includes:
s201, a management center acquires configuration parameters of an availability detection task for a web system;
specifically, the management center generates configuration parameters based on data added by the user, and the configuration parameters include: the URL of the web system, the IP address of the URL, the port number, the authoritative DNS server address, the recursive DNS server address, the request timeout duration and the alarm parameter. In order to ensure normal use of the user and have higher reference value, the recursive DNS server address acquired by the local network card of the detection engine is extracted as the value of the 'recursive DNS server address' option. It should be noted that the URL field has a host header determination, and if the host header is determined as an IP address, the value of the option "authoritative DNS server address" is null. The URL request timeout duration defaults to 10 seconds.
And after the user saves and submits the configuration parameters, the management center actively synchronizes the configuration parameters to the central machine.
S202, the central machine generates a configuration file according to the configuration parameters;
s203, when the central machine reaches a preset number every preset time or the change number of the configuration files reaches a preset number, the configuration files are sent to a detection engine so as to synchronize the configuration files;
the central machine receives the configuration parameters from the management center and writes the configuration parameters into the configuration file, and in order to ensure effective synchronization of the detection engine data and the central machine, the central machine comprises a version file named version and a synchronization module. And the synchronization module is used for judging whether the configuration files on the detection engines are consistent with the central machine or not according to the version files, and if the configuration files are not consistent with the central machine, a synchronization instruction is issued to the detection engines. In order to avoid frequent synchronization scenes caused by continuous submission of detection tasks by a user in a management center in a short time, the central machine of the embodiment executes a synchronization operation once every preset time or when the change times of the configuration file reach preset times. For example, the central machine actively sends the configuration file to the detection engine every 10 minutes, or the detection engine is informed to actively synchronize the configuration file to the central machine only when the version file is changed for more than 10 times.
S204, the detection engine initiates an access request to the URL, the IP address and the DNS server address in the configuration file to obtain detection data;
the detection engine establishes an availability detection task according to the synchronized configuration file, simulates a general user to initiate access to a URL (Uniform resource locator), an IP (Internet protocol) address and an authoritative DNS (Domain name Server) address of a web system needing availability detection, acquires detection data and sends the detection data to the data analysis equipment, wherein the detection data comprises a DNS analysis state, an HTTP response code, URL request response time, IP request response time and a webpage title.
S205, the data analysis equipment judges whether the detection data of each access request meets a normal service condition, an abnormal service condition and a fault condition; if the detected data meets the service normal condition, determining that the web system service is normal; if the detected data meets the abnormal service condition or the fault condition, jumping to S206;
s206, if the proportion of the detection data meeting the alarm triggering condition in the detection data of the multiple access requests reaches a preset proportion, generating an alarm parameter by the data analysis equipment;
and S207, generating alarm information by the alarm equipment according to the alarm parameters.
The usability detection system detects the web system, the concept that the web system has a service state is divided into three states of 'normal service', 'abnormal service' or 'fault' in the embodiment, and when the satisfied state is 'abnormal service' or 'fault', the data analysis device generates an alarm parameter and sends the alarm parameter to the alarm device. In this embodiment, a judgment condition for normal service, a judgment condition for abnormal service, and a judgment condition for fault are preset, and the following specific conditions are set:
the service normal condition is as follows: the code value of the HTTP response code is within a first range and the URL request response time is within a second range;
the service exception condition is as follows: the code value of the HTTP response code is in the first range, the URL request response time is not in the first range, and the IP request response time is in the first range, or the code value of the HTTP response code is in a third range, or the webpage titles in the detection data of multiple access requests are different;
the fault conditions are: the code value of the HTTP response code is in a fourth range, or the HTTP response code is not received, or the DNS analysis state is failure.
For convenience of understanding, the following further explains the normal service condition, abnormal service condition, and fault condition of the present embodiment by taking a specific condition setting situation in an actual application scenario as an example:
(1) service normal conditions: the detection engine carries out simulation request on the URL, the IP address and the authoritative DNS server, requests the URL and can obtain the HTTP response code, the webpage title and the DNS analysis result below 400 within 10 seconds. It should be noted that, when the host header of the URL is an IP address, the response result of the authoritative DNS server is ignored.
(2) Service exception condition: the detection engine carries out simulation request on the URL, the IP address and the authoritative DNS server, and one of the following conditions needs to be met:
① it takes more than 10 seconds to obtain HTTP response code under 400 when requesting URL, but the request IP address requests HTTP response code in 10 seconds;
② requesting URL to obtain HTTP response code above 400 and below 500;
(3) a fault condition: the detection engine carries out simulation request on the URL, the IP address and the authoritative DNS server, and one of the following conditions needs to be met:
① requesting URL to obtain response code above 500;
② requests URL and IP address to have response such as "request timeout (Connection timed out)", "request rejected (Connection returned)", "request reset by peer", "network not pass (normal to host)";
③ when the host header of the request URL is the domain name, the domain name resolution result can not be obtained by the domain name authority DNS or the recursion DNS.
As a specific embodiment, S204 and S205 are repeatedly executed with 5 minutes as a time period, and the detection data of the multiple access requests and the service state determination result of the detection data are obtained. If two service state judgment results of 'normal service' and 'abnormal service' exist at the same time, and the proportion of 'abnormal service' is more than or equal to 50%, the state of the web system on the detection engine in the period is regarded as 'abnormal service'; if the proportion of "anomalies" is greater than or equal to 50%, then the state of the web system on the detection engine during this period is deemed to be "faulty".
Therefore, the usability detection method for the web system provided by the embodiment is based on multiple dimension simulation requests such as domain name resolution detection, URL detection, IP address HTTP detection and the like of an authoritative DNS side and a recursive DNS side, can effectively reduce the false alarm condition generated when the existing usability detection only meets the condition of individual dimension, and improves the accuracy. Finally, the purpose of carrying out availability detection on the web system from multiple dimensions is achieved, and the objectivity and reliability of the availability detection are improved.
In the following, an availability detecting apparatus of a web system provided by an embodiment of the present application is introduced, and the following description of the availability detecting apparatus of the web system and the above description of the availability detecting method of the web system may be referred to correspondingly.
As shown in fig. 3, the apparatus of the present embodiment includes:
the configuration module 301: the method comprises the steps of obtaining configuration parameters of an availability detection task for the web system;
the file sending module 302: the system comprises a configuration engine, a detection engine and a data processing module, wherein the configuration engine is used for generating a configuration file according to the configuration parameters and sending the configuration file to the detection engine;
the detection module 303: the detection engine is used for determining a URL, an IP address and a DNS server address in the configuration file, and respectively initiating an access request to the URL, the IP address and the DNS server address to obtain detection data, wherein the detection data comprises a DNS analysis state, an HTTP response code, URL request response time and IP request response time;
the alarm module 304: and the alarm information generating unit is used for generating alarm information when the detection data meet alarm triggering conditions.
The availability detection apparatus of the web system of the present embodiment is used to implement the foregoing availability detection method of the web system, and therefore specific implementations of the apparatus may refer to the foregoing embodiments of the availability detection method of the web system, for example, theconfiguration module 301, thefile sending module 302, thedetection module 303, and thealarm module 304, which are respectively used to implement steps S101, S102, S103, and S104 in the foregoing availability detection method of the web system. Therefore, specific embodiments thereof may be referred to in the description of the corresponding respective partial embodiments, and will not be described herein.
In addition, since the usability detection apparatus of the web system of this embodiment is used to implement the usability detection method of the web system, its role corresponds to that of the method described above, and is not described here again.
In addition, the present application also provides an availability detection system of a web system, as shown in fig. 4, including: the system comprises a management center, a center machine, a detection engine, data analysis equipment and an alarm.
The construction process of the system comprises the following steps:
establishing a management center for establishing, releasing, editing, deleting and other working states of the usability detection task;
establishing a central machine for generating a configuration file according to the configuration parameters of the availability detection tasks issued by the management center and sending the configuration file to each detection engine, wherein the central machine and the detection engines respectively comprise a synchronization module for monitoring whether the configuration files of each detection engine are synchronized with the central machine;
establishing a plurality of detection engines in a plurality of regions respectively, wherein the detection engines are provided with an HTTP response code acquisition module, a page title acquisition module, a DNS analysis state acquisition module and a synchronization module;
and establishing data analysis equipment and alarm equipment.
In the actual usability detection process, the roles of the components in the usability detection system of the web system of the embodiment are as follows: the management center is used for acquiring configuration parameters of an availability detection task for the web system; the central machine is used for generating a configuration file according to the configuration parameters and sending the configuration file to the detection engine; the detection engine is used for determining a URL, an IP address and a DNS server address in the configuration file, and respectively initiating an access request to the URL, the IP address and the DNS server address to obtain detection data, wherein the detection data comprises a DNS analysis state, an HTTP response code, URL request response time and IP request response time; the data analysis equipment is used for judging whether the detection data meet an alarm triggering condition; the alarm is used for generating alarm information when the detection data meets alarm triggering conditions.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The above detailed descriptions of the solutions provided in the present application, and the specific examples applied herein are set forth to explain the principles and implementations of the present application, and the above descriptions of the examples are only used to help understand the method and its core ideas of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.