CN107241229B - Service monitoring method and device based on interface testing tool - Google Patents

Service monitoring method and device based on interface testing tool Download PDF

Info

Publication number
CN107241229B
CN107241229B CN201710533721.2A CN201710533721A CN107241229B CN 107241229 B CN107241229 B CN 107241229B CN 201710533721 A CN201710533721 A CN 201710533721A CN 107241229 B CN107241229 B CN 107241229B
Authority
CN
China
Prior art keywords
monitoring
test
log
information
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
CN201710533721.2A
Other languages
Chinese (zh)
Other versions
CN107241229A (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.)
Qianxin Technology Group Co Ltd
Original Assignee
Qianxin Technology Group 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 Qianxin Technology Group Co Ltd filed Critical Qianxin Technology Group Co Ltd
Priority to CN201710533721.2A priority Critical patent/CN107241229B/en
Publication of CN107241229A publication Critical patent/CN107241229A/en
Application granted granted Critical
Publication of CN107241229B publication Critical patent/CN107241229B/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
    • 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
    • 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
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/14Network analysis or design
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Telephonic Communication Services (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the invention discloses a service monitoring method and a device based on an interface test tool, aiming at a certain target server needing to be monitored of a target service, the method adopts the interface test tool on a monitoring server to test the target server through target identification information of the target server if network communication between the target server and the monitoring server is judged, a test log is generated, and then a test result recorded in the test log is added into the monitoring log. Because the interface testing tool corresponding to the target service can simulate the terminal equipment to send messages to the target server, and the interface testing tool runs on the monitoring server, the problem of the server can be timely and comprehensively reflected under the condition that an additional client is not occupied. On the other hand, the running state of the target server is recorded through the monitoring log, so that the running state of the server can be conveniently extracted and analyzed in time.

Description

Service monitoring method and device based on interface testing tool
Technical Field
The present invention relates to the field of service monitoring technologies, and in particular, to a service monitoring method and apparatus based on an interface test tool.
Background
Monitoring a server corresponding to a specific service is significant for guaranteeing normal operation of the service, and particularly, service monitoring on the service is difficult because a private protocol type service communicated by a Transmission Control Protocol (TCP) uses a private protocol and is not universal. At present, the service of the private protocol is mainly monitored by the following three methods. The first is to monitor the hardware resources and server states of the hardware server deploying the private protocol service, so as to ensure the timely response when the server hardware and system resources are overloaded. For example, the monitored monitoring objects include CPU usage, system load, memory usage, disk space, IO, network traffic, bandwidth, and the like. However, the monitoring of hardware and server resources is only suitable for the overload situation in which the hardware and system operation status of the server is known in time, and the problem of overload is located. Although the service has certain problems when the hardware resources and the system running state are abnormal, the other way is true, so that the method cannot be used as an alternative mode for service monitoring and can only be used as a supplementary mode for service monitoring. The second method is to know the availability of the server according to the user feedback, however, because the user cannot perceive the conditions of potential hidden danger, short-term unavailability, failure of a certain server in the cluster environment and the like in the service operation process, the feedback is possible only when the service of the service affects the normal use of the user and the user has no alternative. And the third is to use a real client to automatically perform service operation by using an automation tool so as to achieve the effect of monitoring the service of the server. However, the real client automatically triggers many protocols or functions during operation, so that the single-time operation time is too long to achieve the effect of frequent monitoring, and the real client occupies more resources, and in most cases, only one client can be operated at the same time in the same computer. The results produced by the real client are difficult to automatically parse and count through the tool.
In the process of implementing the embodiment of the present invention, the inventor finds that the existing method for monitoring the service on the server through the state parameters of the server or the terminal cannot timely and comprehensively reflect the problem of the server, and the terminal consumes more resources in the monitoring process, and the monitoring result is not easy to analyze.
Disclosure of Invention
The technical problem to be solved by the invention is how to solve the problem that the server cannot be timely and comprehensively reflected by a method for monitoring the service on the server through the state parameters of the server or the terminal, and the problems that the terminal consumes more resources in the monitoring process and the monitoring result is not easy to analyze.
In view of the above technical problems, an embodiment of the present invention provides a service monitoring method based on an interface test tool, including:
acquiring target identification information, and judging whether a network between a target server corresponding to the target identification information and a monitoring server is communicated or not;
if the network between the target server and the monitoring server is communicated, operating an interface testing tool on the monitoring server, testing the target service in the target server, and generating a testing log;
reading a test result in the test log, and adding the test result to a monitoring log;
the monitoring log is generated by monitoring the target service in the target server.
Optionally, the reading the test result in the test log and adding the test result to the monitoring log includes:
reading the test result in the test log, and description information describing the test result or analysis information analyzing the test result;
adding the test result and the description information or the analysis information to the monitoring log according to a first format matched with the monitoring log;
and deleting the test log.
Optionally, before reading the test result in the test log and the description information describing the test result or the analysis information analyzing the test result, the method further includes:
judging whether the test log exists or not, if so, reading the test result, and the description information or the analysis information;
and if the test log does not exist, adding first monitoring information which does not exist in the test log into the monitoring log according to the first format.
Optionally, the determining whether the test log exists, and if so, reading the test result, and the description information or the analysis information includes:
judging whether the test log exists or not, and if so, judging whether the process of testing the target service in the target server by the interface test tool is finished or not according to the test log;
if the process is not finished, judging whether the duration of the test of the interface test tool on the target service in the target server exceeds a preset duration, if so, finishing the process, reading the test result and the description information or the analysis information, otherwise, finishing the process when the process is finished within the preset duration or when the duration reaches the preset duration, or reading the test result and the description information or the analysis information;
and if the process is judged to be finished, reading the test result, the description information or the analysis information.
Optionally, the obtaining target identification information and determining whether a network between a target server corresponding to the target identification information and a monitoring server is connected further includes:
and if the network between the target server and the monitoring server is not communicated, adding second monitoring information of the network between the target server and the monitoring server which is not communicated into the monitoring log according to the first format.
Optionally, after reading the test result in the test log and adding the test result to the monitoring log, the method further includes:
and displaying the test result, the first monitoring information or the second monitoring information read from the monitoring log according to a second format.
Optionally, the method further comprises:
and if the test result, the first monitoring information or the second monitoring information is judged not to be consistent with a preset result, sending alarm information.
Optionally, the reading the test result in the test log and adding the test result to the monitoring log includes:
according to the first format, the test result, the first monitoring information or the second monitoring information are added to the monitoring log to obtain an added monitoring log;
and/or the presence of a gas in the gas,
deleting the content currently stored in the monitoring log, and adding the test result, the first monitoring information or the second monitoring information to the monitoring log according to the first format to obtain a coverage monitoring log.
Optionally, before the obtaining the target identification information of the target server to be monitored, the method further includes:
and circularly acquiring the identification information which is not traversed from the identification information of at least one server corresponding to the target service, wherein the identification information is used as the target identification information until all the identification information is traversed.
Optionally, the identification information includes location information of the server and/or a name of a machine room to which the server belongs.
In a second aspect, an embodiment of the present invention provides a service monitoring apparatus based on an interface test tool, including:
the judging module is used for acquiring target identification information and judging whether a network between a target server corresponding to the target identification information and a monitoring server is communicated or not;
the test module is used for operating an interface test tool on the monitoring server if the network between the target server and the monitoring server is communicated, testing the target service in the target server and generating a test log;
the adding module is used for reading the test result in the test log and adding the test result to the monitoring log;
the monitoring log is generated by monitoring the target service in the target server.
Optionally, the adding module is further configured to read the test result in the test log, and description information describing the test result or analysis information analyzing the test result; adding the test result and the description information or the analysis information to the monitoring log according to a first format matched with the monitoring log; and deleting the test log.
Optionally, the adding module is further configured to determine whether the test log exists before the reading of the test result in the test log and the description information describing the test result or the analysis information analyzing the test result, and if so, read the test result and the description information or the analysis information; and if the test log does not exist, adding first monitoring information which does not exist in the test log into the monitoring log according to the first format.
Optionally, the adding module is further configured to determine whether the test log exists, and if the test log exists, determine whether a process of testing the target service in the target server by the interface test tool is finished according to the test log; if the process is not finished, judging whether the duration of the test of the interface test tool on the target service in the target server exceeds a preset duration, if so, finishing the process, reading the test result and the description information or the analysis information, otherwise, finishing the process when the process is finished within the preset duration or when the duration reaches the preset duration, or reading the test result and the description information or the analysis information; and if the process is judged to be finished, reading the test result, the description information or the analysis information.
Optionally, the determining module is further configured to add, according to the first format, second monitoring information that the network between the target server and the monitoring server is not connected to the monitoring log if it is determined that the network between the target server and the monitoring server is not connected.
Optionally, the monitoring system further comprises a display module, and the display module is further configured to display the test result, the first monitoring information, or the second monitoring information read from the monitoring log according to a second format.
Optionally, the display module is further configured to send alarm information if it is determined that the test result, the first monitoring information, or the second monitoring information does not match a preset result.
Optionally, the adding module is further configured to add the test result, the first monitoring information, or the second monitoring information to the monitoring log according to the first format to obtain an added monitoring log;
and/or the presence of a gas in the gas,
deleting the content currently stored in the monitoring log, and adding the test result, the first monitoring information or the second monitoring information to the monitoring log according to the first format to obtain a coverage monitoring log.
Optionally, the system further includes a traversal module, and the traversal module is further configured to cyclically acquire unretraversed identification information from identification information of at least one server corresponding to the target service, as the target identification information, until all the identification information is traversed.
Optionally, the identification information includes location information of the server and/or a name of a machine room to which the server belongs.
In a third aspect, an embodiment of the present invention provides an electronic device, including:
at least one processor, at least one memory, a communication interface, and a bus; wherein the content of the first and second substances,
the processor, the memory and the communication interface complete mutual communication through the bus;
the communication interface is used for information transmission between the electronic equipment and the communication equipment of other servers;
the memory stores program instructions executable by the processor, which when called by the processor are capable of performing the methods described above.
In a fourth aspect, embodiments of the invention provide a non-transitory computer-readable storage medium storing computer instructions that cause the computer to perform the method described above.
The embodiment of the invention provides a service monitoring method and a device based on an interface test tool, aiming at a certain target server needing to be monitored of a target service, the method adopts the interface test tool on a monitoring server to test the target server through target identification information of the target server if network communication between the target server and the monitoring server is judged, a test log is generated, and then a test result recorded in the test log is added into the monitoring log. And monitoring whether the target service in the target server is abnormal or not through the monitoring log. Because the interface testing tool corresponding to the target service can simulate the terminal equipment to send messages to the target server, and the interface testing tool runs on the monitoring server, the problem of the server can be timely and comprehensively reflected under the condition that an additional client is not occupied. On the other hand, the running state of the target server is recorded through the monitoring log, so that the running state of the server can be conveniently extracted and analyzed in time.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a service monitoring method based on an interface test tool according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a service monitoring method based on an interface test tool according to another embodiment of the present invention;
fig. 3 is a block diagram of a service monitoring apparatus based on an interface test tool according to another embodiment of the present invention;
fig. 4 is a schematic physical structure diagram of an electronic device according to another embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, 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 some, but not all, embodiments of the present invention. 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.
Fig. 1 is a schematic flowchart of a data management service monitoring method based on an interface test tool provided in this embodiment, and referring to fig. 1, the method includes:
101: acquiring target identification information, and judging whether a network between a target server corresponding to the target identification information and a monitoring server is communicated or not;
102: if the network between the target server and the monitoring server is communicated, operating an interface testing tool on the monitoring server to test the target service in the target server and generate a testing log;
103: reading a test result in the test log, and adding the test result to a monitoring log;
the monitoring log is generated by monitoring the target service in the target server.
It should be noted that the method provided by the present embodiment is executed by the monitoring server. When the network between the monitoring server and the monitored target server is communicated, the monitoring server sends a test instruction to the target server through the interface test tool, generates a test log according to a received test result fed back by the target server, records a test result of whether the function corresponding to the test instruction is normal or not, adds the test result to the monitoring log, and can know whether the function tested by the interface test tool is normal or not through the monitoring log. The method provided in this embodiment may monitor the server corresponding to the service based on the basic protocol, and may also monitor the server corresponding to the service based on the private protocol, as long as the provided interface test tool can detect the service of the corresponding protocol, which is not limited in this embodiment.
The key point of the interface testing tool is to check the exchange of data, transfer and control management processes, and mutual logic dependency relationship between systems. For example, when checking whether the wechat service login process on the target server is normal, the interface test tool sends a correct login user name and a correct login password to an interface corresponding to the wechat service of the target server, if the detection result fed back by the target server is successful login, the wechat service login process on the target server is normal, and if the detection result fed back by the target server is failed login, the wechat service login process on the target server is abnormal. It is understood that the target service may be WeChat service, BlueTooth service, or QQ service, etc., and the embodiment does not limit this.
It can be understood that, for a certain target server, the monitoring method can be periodically executed, and real-time monitoring of target services on the target server is realized. Of course, the monitoring method can also be executed once, and monitoring of the target service on the target server at a specific time point is realized. The monitoring method provided by the embodiment is executed for a plurality of target servers and each target server, so that the plurality of servers can be monitored in real time at the same time.
It should be noted that the target identification information is identification information corresponding to a server to be monitored in a server corresponding to a target service stored in advance. Generally, there are a plurality of servers corresponding to a target service, and identification information corresponding to each server is stored in order to monitor each server corresponding to the target service. In the process of monitoring the servers corresponding to the target service, in order to ensure that each server is monitored, a traversal method is adopted to acquire one piece of identification information which is not traversed from the identification information as target identification information each time, the target server corresponding to the target identification information is monitored, and when all the identification information is traversed, each server corresponding to the target service is monitored. In the actual process, the traversal process is circularly executed, so that the real-time monitoring of the server corresponding to the target service is realized.
The embodiment of the invention provides a service monitoring method based on an interface test tool, which aims at a certain target server needing to be monitored of a target service, tests the target server by adopting the interface test tool on the monitoring server through target identification information of the target server if network communication between the target server and the monitoring server is judged, generates a test log, and then adds a test result recorded in the test log into the monitoring log. And monitoring whether the target service in the target server is abnormal or not through the monitoring log. Because the interface testing tool corresponding to the target service can simulate the terminal equipment to send messages to the target server, and the interface testing tool runs on the monitoring server, the problem of the server can be timely and comprehensively reflected under the condition that an additional client is not occupied. On the other hand, the running state of the target server is recorded through the monitoring log, so that the running state of the server can be conveniently extracted and analyzed in time.
Further, on the basis of the above embodiment, the reading the test result in the test log and adding the test result to the monitoring log includes:
reading the test result in the test log, and description information describing the test result or analysis information analyzing the test result;
adding the test result and the description information or the analysis information to the monitoring log according to a first format matched with the monitoring log;
and deleting the test log.
It should be noted that different logs correspond to different formats, for example, different languages, different layouts, and the like of the different logs. In the process of adding the test result in the test log to the monitoring log, the test result of the test log is not copied, but the character string related to the test result in the test log is converted into the character string matched with the first format according to the first format corresponding to the monitoring log, and the converted test result is added to the monitoring log.
Generally, the test log has description information or analysis information corresponding to each test result. For example, in a test result obtained by testing the login of the wechat service on the target server, if the test result is successful login, description about test content of the test is available in the test log, and the description is description information. If the test result is a login failure, the reason analysis about the test failure of the test is carried out in the test log, the reason analysis is analysis information, and in order to perfect the integrity of the information added to the monitoring log, the test result and the analysis information corresponding to the test result can be added to the monitoring log.
In order to save the space resources occupied by the generated test log, the test log may be deleted after the test results in the test log and the corresponding description information or analysis information are added to the monitoring log.
In the service monitoring method based on the interface test tool provided by this embodiment, in the process of generating the monitoring log according to the test log, the content in the test log is extracted by the method provided by this embodiment, converted into the content in the first format, and added to the monitoring log, so that the readability and integrity of the information added to the monitoring log are ensured. On the other hand, the method for deleting the test log in time avoids the test log and saves the storage space.
Further, on the basis of the foregoing embodiments, before reading the test result in the test log, and description information describing the test result or analysis information analyzing the test result, the method further includes:
judging whether the test log exists or not, if so, reading the test result, and the description information or the analysis information;
and if the test log does not exist, adding first monitoring information which does not exist in the test log into the monitoring log according to the first format.
According to the above embodiment, after the test results in the test log and the corresponding description information or analysis information are added to the monitoring log, the test log is deleted. When the content in the test log is read again, it may be determined whether the test log exists (i.e., it is determined whether a log is newly generated at the current time point or within a preset time period before the current time point), and if it is determined that the test log does not exist, a result of the absence of the test log is added to the monitoring log as the first monitoring information.
It can be understood that, in the process of monitoring the target service on the target server, whether the test log exists or not is periodically judged according to the time required by the interface test tool to complete one detection process. For example, if the interface test tool needs 2S to complete one detection process, it may determine whether a test log exists every 2S, if not, add the result that the test log does not exist to the monitoring log, and if so, add the test result recorded in the test log to the monitoring log, and delete the test log.
In the service monitoring method based on the interface test tool provided by this embodiment, in the process of determining the existence of the test log, the method provided by this embodiment considers the situation that may be encountered in the process of generating the test log by the interface test tool, thereby adding the step of determining the existence of the test log, refining the monitoring step, and perfecting the monitoring process.
Further, on the basis of the foregoing embodiments, the determining whether the test log exists, and if so, reading the test result, and the description information or the analysis information includes:
judging whether the test log exists or not, and if so, judging whether the process of testing the target service in the target server by the interface test tool is finished or not according to the test log;
if the process is not finished, judging whether the duration of the test of the interface test tool on the target service in the target server exceeds a preset duration, if so, finishing the process, reading the test result and the description information or the analysis information, otherwise, finishing the process when the process is finished within the preset duration or when the duration reaches the preset duration, or reading the test result and the description information or the analysis information;
and if the process is judged to be finished, reading the test result, the description information or the analysis information.
In the above-mentioned embodiment, in the case that the test log is detected to exist, if the test log exists, it is determined whether the test process in the interface test tool is ended, and if the test process is ended, it is determined that the current test log is a log in which all contents to be tested by the interface test tool are recorded, the test result is directly read, and the test result is added to the monitoring log. If the process is not finished, it indicates that the interface test tool has not finished all the test contents, and in order to avoid that the interface test tool runs for too long time due to the logic of the interface test tool itself, the test process of the interface test tool can be forcibly terminated according to the preset time length.
For example, the preset time duration is 5S, when it is detected that the test process of the interface test tool is not finished, whether the duration of the test of the interface test tool exceeds 5S in the current test process is judged according to the record of the time in the test log generated currently, if yes, the process is directly finished, the test result in the current test log is added into the monitoring log, the current test log is deleted, and the interface test tool is controlled to perform the next test. If the duration of the interface testing tool for testing does not exceed 5S, the duration of the interface testing tool for testing reaches 5S, the process of the interface testing tool for testing is ended, the generated testing result in the testing log is added into the monitoring log, or the duration of the interface testing tool for testing is automatically ended before the duration of the interface testing tool for testing does not reach 5S, and the testing log is directly read after the process is automatically ended.
The embodiment provides a method for judging whether the test process of the interface test log is finished or not under the condition that the test log exists, and the method avoids the influence on the generation of the monitoring log caused by the logic error of an interface test tool.
Further, on the basis of the foregoing embodiments, the obtaining target identification information and determining whether a network between a target server corresponding to the target identification information and a monitoring server is connected further includes:
and if the network between the target server and the monitoring server is not communicated, adding second monitoring information of the network between the target server and the monitoring server which is not communicated into the monitoring log according to the first format.
The embodiment provides a method for generating the monitoring log when the network corresponding to the target server is not connected with the monitoring server. The method takes the network connection condition between the target server and the monitoring server as the monitoring content, and improves the integrity of the monitoring process of the monitoring log.
Further, on the basis of the foregoing embodiments, after reading the test result in the test log and adding the test result to the monitoring log, the method further includes:
and displaying the test result, the first monitoring information or the second monitoring information read from the monitoring log according to a second format.
Further, on the basis of the above embodiments, the method further includes:
and if the test result, the first monitoring information or the second monitoring information is judged not to be consistent with a preset result, sending alarm information.
Aiming at the monitoring log generated by the target service, the content in the monitoring log can be converted into a character language according to the second format and displayed to the staff, and an alarm is given according to the abnormal condition so as to prompt the staff to take corresponding measures in time.
It should be noted that, in the process of visualizing the monitoring log, the characters in the monitoring log may be directly converted into a text language, and the text language is displayed on the display interface according to a second format (for example, the second format specifies the position of each detection result on the display interface). The monitoring log may also be visualized through docking with a third-party platform (e.g., grafana), which is not limited in this embodiment.
And aiming at the test result, the first monitoring information or the second monitoring information, the normal state or the normal numerical range corresponding to the test result, the first monitoring information or the second monitoring information is the preset result. It can be understood that whether the test result, the first monitoring information, or the second monitoring information in the monitoring log matches the preset result may be directly determined according to the test result, the first monitoring information, or the second monitoring information in the monitoring log, or after the test result, the first monitoring information, or the second monitoring information is visualized, whether the visualized test result, the first monitoring information, or the second monitoring information matches the preset result may be determined, which is not limited in this embodiment.
When the test result, the first monitoring information or the second monitoring information does not match the preset result, the alarm information may be sent in a manner of sending a short message or sending a mail to a corresponding worker, or the alarm information may be sent by flashing an alarm lamp or by sound, which is not limited in this embodiment.
For example, when the detection result of a certain target server corresponding to the WeChat service in the monitoring log is abnormal for logging in, alarm information of the abnormality of the WeChat logging in the target server is sent to corresponding staff.
The embodiment provides a method for visualizing the monitoring log and giving an alarm when detecting that an abnormal monitoring result exists in the monitoring log. By the method, related workers can timely know the running condition of each server of the target service and timely process the abnormal target server.
Further, on the basis of the foregoing embodiments, the reading the test result in the test log and adding the test result to the monitoring log includes:
according to the first format, the test result, the first monitoring information or the second monitoring information are added to the monitoring log to obtain an added monitoring log;
and/or the presence of a gas in the gas,
deleting the content currently stored in the monitoring log, and adding the test result, the first monitoring information or the second monitoring information to the monitoring log according to the first format to obtain a coverage monitoring log.
The embodiment provides two ways of generating the monitoring log, one way is to form an additional monitoring log in an additional way, and the other way is to form a coverage monitoring log in a coverage way. In an actual situation, only one of the two logs may be generated as needed, or both logs may be generated at the same time. The additional monitoring log records all monitoring information of the target service in a certain target server in a certain time period (for example, a certain day). And only the monitoring information newly generated by the target service in a certain target server is stored in the coverage monitoring log. For the coverage monitoring log, when the newly generated monitoring information needs to be read, the step of searching can be omitted, and the monitoring information can be directly read.
Further, on the basis of the foregoing embodiments, before the obtaining the target identification information of the target server to be monitored, the method further includes:
and circularly acquiring the identification information which is not traversed from the identification information of at least one server corresponding to the target service, wherein the identification information is used as the target identification information until all the identification information is traversed.
The embodiment provides a method for monitoring a plurality of servers corresponding to a target service, each server of the target service can be ensured to be monitored through a traversal method, and the target service is comprehensively monitored.
Further, on the basis of the foregoing embodiments, the identification information includes location information of the server and/or a name of a machine room to which the server belongs.
In the process of determining the identification information of the target server, a combination of a domain name and an IP address of an area where the target server is located may be selected as the unique identification of the target server. In the method provided by this embodiment, in order to facilitate the staff to determine the location of each server or the company to which the server belongs quickly and qualitatively, the location information of the server, or the name of the machine room to which the server belongs, or the name of the company to which the server belongs is added to the identification information of the server, so that the staff can determine the identity of the server quickly. For example, the identification information of the server is named "qihu 360_ 1", "qihu 360_ 2", "xin _ hua _ she _ 1", and the like. It is understood that the identification information includes only content that enables the staff member to quickly identify the basic information of the server.
The embodiment provides a method for generating identification information of a server, which can enable a worker to quickly and qualitatively determine the position of the server or a company to which the server belongs, so as to realize quick and accurate positioning of the server.
Fig. 2 shows a schematic flowchart of a service monitoring method based on an interface test tool according to this embodiment, and referring to fig. 2, the method includes:
201: if not, go to step 216, otherwise go to step 202. Monitoring is performed on a plurality of target servers of a target service, and each target server needs to be traversed. For example, a directory named "running _ output" is created, and the identification information of the server to be monitored is placed under "running _ output" as a sub-directory, for example, the sub-directory of "running _ output" includes the identification information of "qihu 360_1, qihu360_2, xin _ hua _ she _ 1" three servers.
Specifically, the interface test tool and the required files are placed under a single subdirectory (qihu360_1, qihu360_2, xin _ hua _ she _1) in the directory (running _ output), information such as IP and port (IP address and port information) of a service server to be monitored is configured, service data to be used by the monitoring tool is configured, and the interface test tool under the subdirectory can operate independently. The executable file name of the interface test tool is named as ip, and the directory name where the executable file name is located is named as readable information of the service server and has a unique identifier (readable identifier), such as "qihu 360_ 1", "qihu 360_ 2", "xin _ hua _ she _ 1", and the like.
The traversal process is executed by a script created in the directory 0run.sh, the script traverses subdirectories under the running _ output directory, and the name of each subdirectory is taken as a parameter to be transmitted to the monitoring script, so that the monitoring of the service server corresponding to the subdirectory is realized. When more servers need to be monitored, only the subdirectories need to be added under the running _ output directory. And setting a task plan, and calling the traversal script according to a certain rule, so that the traversal script is periodically executed.
202: and acquiring the identification information which is not traversed as target identification information.
203: and if the network between the target server and the monitoring server corresponding to the target identification information is connected, executing step 204, otherwise, executing step 215.
For example, parameters such as the subdirectory names of the interface test tools mentioned above, such as "qihu 360_ 1", "qihu 360_ 2", "xin _ hua _ she _ 1", etc., are passed to a monitoring script (e.g., a script named getstate. And the monitoring script acquires the ip, port and other information of the service server under the directory corresponding to the parameters according to the configuration rule of the interface test tool. The monitoring script acquires the date and time of execution, defines the name and path of the monitoring log: named by the current date, the server readable identifier and the ip identifier, the path is stored in the current directory of the monitoring script (for example, ipName, today, nowtime, logame _ today and logame _ now are included in the current directory of the monitoring script).
For example, a telnet ip port is used to detect whether a service server is in a connected state with a server where a monitoring tool is located. If yes, executing step 204; if not, the result is recorded to the file of the monitoring log.
204: and testing the target service on the target server through the interface testing tool.
205: if a test log exists, execute 206, if not, execute 214. Namely, the existence of the test log of the interface test tool is judged, if yes, step 206 is executed; if not, recording the data in the file of the monitoring log.
206: if the testing process of the interface testing tool is finished, step 213 is executed, otherwise, step 207 is executed. Namely, the interface testing tool is executed, the interface testing tool waits according to the time length consumed by the interface testing tool, and then the process operated by the interface testing tool is ended according to the rule.
207: if the duration of the process exceeds the preset duration, go to step 209, otherwise go to step 208.
208: and ending the process when the process is ended within the preset time length or when the duration time of the process reaches the preset time length to obtain the test log.
209: and ending the process to obtain a test log.
210: and adding the test result in the test log, the description information or the analysis information corresponding to the test result into the monitoring log according to the first format, and deleting the test log. Analyzing a test log of the interface test tool, and recording a success mark and a fixed character string if a successfully corresponding character string exists in the test log; and if the character string corresponding to the failure exists in the test log, recording a failure mark and a failure reason. And cleaning a test log generated by the interface test tool.
211: and obtaining monitoring logs (additional monitoring logs and coverage monitoring logs). Wherein, all the log records have the following rules: adding the log to the current day's log file (logname _ today variable); the log is overwritten into the current log file (logname _ now). The method provided by the embodiment can use a third-party monitoring system mainly because the graphical display effect is good, the alarm mechanism is complete, and the wheel is not repeatedly manufactured.
212: and displaying the monitoring log according to the second format, and giving an alarm according to the information which is not consistent with the preset result in the monitoring log. The log generated by the monitoring tool is analyzed and is in butt joint with a third-party display platform, so that the integration of monitoring, displaying and alarming is realized.
213: and obtaining a test log.
214: and adding the first monitoring information without the test log into the monitoring log.
215: and adding second monitoring information of which the network between the target server and the monitoring server is not communicated into the monitoring log.
216: the process results are monitored in the current round.
The monitoring log at least comprises the current time, the shorthand of the service server, an ip address, a monitoring result mark and a monitoring detailed result.
With the increase of the service servers, when a newly-added monitoring server is needed, the method provided by the embodiment only needs to add a corresponding tool directory under a specific directory, automatically triggers a monitoring mechanism, and realizes monitoring of services in the server.
Fig. 3 shows a block diagram of a service monitoring apparatus based on an interface test tool according to an embodiment of the present invention, and referring to fig. 3, the service monitoring apparatus 300 based on an interface test tool includes a determining module 301, a testing module 302 and an adding module 303, wherein,
a judging module 301, configured to obtain target identification information, and judge whether a network between a target server and a monitoring server corresponding to the target identification information is connected;
a test module 302, configured to run an interface test tool on the monitoring server if the target server is connected to the monitoring server through a network, test a target service in the target server, and generate a test log;
an adding module 303, configured to read a test result in the test log, and add the test result to the monitoring log;
the monitoring log is generated by monitoring the target service in the target server.
The interface test tool-based service monitoring apparatus 300 provided in this embodiment is suitable for the interface test tool-based service monitoring method provided in the above embodiments, and details are not repeated here.
The embodiment of the invention provides a service monitoring device based on an interface test tool, aiming at a certain target server needing to be monitored of a target service, the device tests the target server by adopting the interface test tool on a monitoring server through target identification information of the target server if network communication between the target server and the monitoring server is judged, a test log is generated, and then a test result recorded in the test log is added into the monitoring log. And monitoring whether the target service in the target server is abnormal or not through the monitoring log. Because the interface testing tool corresponding to the target service can simulate the terminal equipment to send messages to the target server, and the interface testing tool runs on the monitoring server, the problem of the server can be timely and comprehensively reflected under the condition that an additional client is not occupied. On the other hand, the running state of the target server is recorded through the monitoring log, so that the running state of the server can be conveniently extracted and analyzed in time.
In a third aspect, fig. 4 is a block diagram illustrating a structure of an electronic apparatus provided in the present embodiment.
Referring to fig. 4, the electronic device includes: a processor (processor)401, a memory (memory)402, a communication Interface (Communications Interface)403, and a bus 404;
wherein the content of the first and second substances,
the processor 401, the memory 402 and the communication interface 403 complete mutual communication through the bus 404;
the communication interface 403 is used for information transmission between the electronic device and a communication device of a target server;
the processor 401 is configured to call the program instructions in the memory 402 to execute the methods provided by the above-mentioned method embodiments, for example, including: acquiring target identification information, and judging whether a network between a target server corresponding to the target identification information and a monitoring server is communicated or not; if the network between the target server and the monitoring server is communicated, operating an interface testing tool on the monitoring server, testing the target service in the target server, and generating a testing log; reading a test result in the test log, and adding the test result to a monitoring log; the monitoring log is generated by monitoring the target service in the target server.
In a fourth aspect, the present embodiment provides a non-transitory computer-readable storage medium storing computer instructions that cause the computer to perform the method provided by the above method embodiments, for example, including: acquiring target identification information, and judging whether a network between a target server corresponding to the target identification information and a monitoring server is communicated or not; if the network between the target server and the monitoring server is communicated, operating an interface testing tool on the monitoring server, testing the target service in the target server, and generating a testing log; reading a test result in the test log, and adding the test result to a monitoring log; the monitoring log is generated by monitoring the target service in the target server.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
The above-described embodiments of the electronic device and the like are merely illustrative, where the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may also be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the embodiments of the present invention, and are not limited thereto; although embodiments of the present invention have been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (16)

1. A service monitoring method based on an interface test tool is characterized by comprising the following steps:
the monitoring server acquires target identification information and judges whether a network between the target server corresponding to the target identification information and the monitoring server is communicated or not;
if the network between the target server and the monitoring server is communicated, sending a test instruction to the target server through an interface test tool, testing the target service in the target server, and generating a test log;
reading a test result in the test log, and adding the test result to a monitoring log;
the monitoring log is generated by monitoring a target service in the target server;
the reading of the test result in the test log and the adding of the test result to the monitoring log include:
reading the test result in the test log, and description information describing the test result or analysis information analyzing the test result;
adding the test result and the description information or the analysis information to the monitoring log according to a first format matched with the monitoring log;
deleting the test log;
the acquiring of the target identification information and the judging of whether the network between the target server corresponding to the target identification information and the monitoring server is connected further comprises:
if the network between the target server and the monitoring server is not communicated, adding second monitoring information of the network between the target server and the monitoring server which is not communicated into the monitoring log according to the first format;
before the obtaining of the target identification information of the target server to be monitored, the method further includes:
and circularly acquiring the identification information which is not traversed from the identification information of at least one server corresponding to the target service, wherein the identification information is used as the target identification information until all the identification information is traversed.
2. The method of claim 1, wherein reading the test result in the test log and the description information describing the test result or the analysis information analyzing the test result further comprises:
judging whether the test log exists or not, if so, reading the test result, and the description information or the analysis information;
and if the test log does not exist, adding first monitoring information which does not exist in the test log into the monitoring log according to the first format.
3. The method of claim 2, wherein said determining whether the test log exists and, if so, reading the test result and the description information or the analysis information comprises:
judging whether the test log exists or not, and if so, judging whether the process of testing the target service in the target server by the interface test tool is finished or not according to the test log;
if the process is not finished, judging whether the duration of the test of the interface test tool on the target service in the target server exceeds a preset duration, if so, finishing the process, reading the test result and the description information or the analysis information, otherwise, finishing the process when the process is finished within the preset duration or when the duration reaches the preset duration, or reading the test result and the description information or the analysis information;
and if the process is judged to be finished, reading the test result, the description information or the analysis information.
4. The method of claim 2, wherein after reading the test results in the test log and adding the test results to the monitoring log, the method further comprises:
and displaying the test result, the first monitoring information or the second monitoring information read from the monitoring log according to a second format.
5. The method of claim 4, further comprising:
and if the test result, the first monitoring information or the second monitoring information is judged not to be consistent with a preset result, sending alarm information.
6. The method of claim 2, wherein reading the test results in the test log and adding the test results to the monitoring log comprises:
according to the first format, the test result, the first monitoring information or the second monitoring information are added to the monitoring log to obtain an added monitoring log;
and/or the presence of a gas in the gas,
deleting the content currently stored in the monitoring log, and adding the test result, the first monitoring information or the second monitoring information to the monitoring log according to the first format to obtain a coverage monitoring log.
7. The method according to claim 6, wherein the identification information includes location information of the server and/or a name of a room to which the server belongs.
8. A service monitoring device based on an interface testing tool is applied to a monitoring server and comprises:
the judging module is used for acquiring target identification information and judging whether a network between a target server corresponding to the target identification information and a monitoring server is communicated or not;
the test module is used for sending a test instruction to the target server through an interface test tool if the target server is connected with the monitoring server through a network, testing the target service in the target server and generating a test log;
the adding module is used for reading the test result in the test log and adding the test result to the monitoring log;
the monitoring log is generated by monitoring a target service in the target server;
the adding module is further used for reading the test result in the test log, and description information describing the test result or analysis information analyzing the test result; adding the test result and the description information or the analysis information to the monitoring log according to a first format matched with the monitoring log; deleting the test log;
the judging module is further configured to add, according to the first format, second monitoring information that the network between the target server and the monitoring server is not connected to the monitoring log if it is judged that the network between the target server and the monitoring server is not connected;
the system further comprises a traversal module, wherein the traversal module is further used for circularly acquiring non-traversed identification information from the identification information of at least one server corresponding to the target service, and the non-traversed identification information is used as the target identification information until all the identification information is traversed.
9. The apparatus according to claim 8, wherein the adding module is further configured to determine whether the test log exists before the reading of the test result in the test log and the description information describing the test result or the analysis information analyzing the test result, and if so, read the test result and the description information or the analysis information; and if the test log does not exist, adding first monitoring information which does not exist in the test log into the monitoring log according to the first format.
10. The apparatus according to claim 9, wherein the adding module is further configured to determine whether the test log exists, and if so, determine whether a process of testing the target service in the target server by the interface test tool is finished according to the test log; if the process is not finished, judging whether the duration of the test of the interface test tool on the target service in the target server exceeds a preset duration, if so, finishing the process, reading the test result and the description information or the analysis information, otherwise, finishing the process when the process is finished within the preset duration or when the duration reaches the preset duration, or reading the test result and the description information or the analysis information; and if the process is judged to be finished, reading the test result, the description information or the analysis information.
11. The apparatus of claim 9, further comprising a display module, wherein the display module is further configured to display the test result, the first monitoring information, or the second monitoring information read from the monitoring log according to a second format.
12. The apparatus of claim 11, wherein the display module is further configured to send an alarm message if it is determined that the test result, the first monitoring message, or the second monitoring message does not match a preset result.
13. The apparatus according to claim 9, wherein the adding module is further configured to add the test result, the first monitoring information, or the second monitoring information to the monitoring log according to the first format to obtain an additional monitoring log;
and/or the presence of a gas in the gas,
deleting the content currently stored in the monitoring log, and adding the test result, the first monitoring information or the second monitoring information to the monitoring log according to the first format to obtain a coverage monitoring log.
14. The apparatus according to claim 13, wherein the identification information includes location information of the server and/or a name of a room to which the server belongs.
15. An electronic device, comprising:
at least one processor, at least one memory, a communication interface, and a bus; wherein the content of the first and second substances,
the processor, the memory and the communication interface complete mutual communication through the bus;
the communication interface is used for information transmission between the electronic equipment and the communication equipment of other servers;
the memory stores program instructions executable by the processor, the processor invoking the program instructions to perform the method of any of claims 1-7.
16. A non-transitory computer-readable storage medium storing computer instructions that cause a computer to perform the method of any one of claims 1-7.
CN201710533721.2A 2017-07-03 2017-07-03 Service monitoring method and device based on interface testing tool Active CN107241229B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710533721.2A CN107241229B (en) 2017-07-03 2017-07-03 Service monitoring method and device based on interface testing tool

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710533721.2A CN107241229B (en) 2017-07-03 2017-07-03 Service monitoring method and device based on interface testing tool

Publications (2)

Publication Number Publication Date
CN107241229A CN107241229A (en) 2017-10-10
CN107241229B true CN107241229B (en) 2020-08-25

Family

ID=59990984

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710533721.2A Active CN107241229B (en) 2017-07-03 2017-07-03 Service monitoring method and device based on interface testing tool

Country Status (1)

Country Link
CN (1) CN107241229B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110489319B (en) * 2018-05-15 2022-12-13 福建天晴数码有限公司 Interface performance test analysis method and storage medium
CN108965057A (en) * 2018-07-23 2018-12-07 高新兴科技集团股份有限公司 A kind of test device and method based on GB/T28181 agreement
CN109471760A (en) * 2018-10-18 2019-03-15 北京趣拿软件科技有限公司 The monitoring method and system of server communication performance, storage medium, electronic device
CN110113224B (en) * 2019-03-19 2022-08-09 深圳壹账通智能科技有限公司 Capacity monitoring method and device, computer equipment and storage medium
CN110196806A (en) * 2019-04-12 2019-09-03 石化盈科信息技术有限责任公司 A kind of dynamic adaptation method of testing service device
CN111967850B (en) * 2020-08-19 2022-10-18 支付宝(杭州)信息技术有限公司 Data reporting monitoring method and device and electronic equipment
CN114371866A (en) * 2020-10-14 2022-04-19 腾讯科技(深圳)有限公司 Version reconfiguration test method, device and equipment of service system
CN113542029A (en) * 2021-07-19 2021-10-22 凌云天博光电科技股份有限公司 Service stability testing method, system and tool of network equipment
CN113821389A (en) * 2021-08-20 2021-12-21 至誉科技(武汉)有限公司 Method, device and equipment for testing performance of solid state disk and readable storage medium

Also Published As

Publication number Publication date
CN107241229A (en) 2017-10-10

Similar Documents

Publication Publication Date Title
CN107241229B (en) Service monitoring method and device based on interface testing tool
CN107294808B (en) Interface test method, device and system
US11789760B2 (en) Alerting, diagnosing, and transmitting computer issues to a technical resource in response to an indication of occurrence by an end user
CN111934922B (en) Method, device, equipment and storage medium for constructing network topology
CN105787364B (en) Automatic testing method, device and system for tasks
US7617086B2 (en) Monitoring simulating device, method, and program
CN110784374A (en) Method, device, equipment and system for monitoring operation state of service system
CN107168844B (en) Performance monitoring method and device
CN113114680B (en) Detection method and detection device for file uploading vulnerability
CN111654495B (en) Method, apparatus, device and storage medium for determining traffic generation source
KR20150025106A (en) Verification apparatus, terminal device, system, method and computer-readable medium for monitoring of application verification result
CN104461847B (en) Data processor detection method and device
CN110069382B (en) Software monitoring method, server, terminal device, computer device and medium
CN116055303A (en) Link monitoring processing method and device, electronic equipment and storage medium
WO2016127483A1 (en) Processing method and device for collection agent management subsystem
CN115509854A (en) Inspection processing method, inspection server and inspection system
CN114338347A (en) Ampere platform-based fault information out-of-band acquisition method and device
CN112799957A (en) User behavior based fault handling method, system, device and medium
CN114416420A (en) Equipment problem feedback method and system
CN113726808A (en) Website monitoring method, device, equipment and storage medium
US20160275002A1 (en) Image capture in application lifecycle management for documentation and support
CN116136818A (en) Health inspection method, device, equipment and medium for message queue
CN117155768A (en) Method and device for monitoring and processing system full link abnormality
CN117608979A (en) Rule visualization method and device, electronic equipment and storage medium
CN114143166A (en) Electronic equipment copy-down test monitoring method and device, electronic equipment and storage medium

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

Address after: 100088 Building 3 332, 102, 28 Xinjiekouwai Street, Xicheng District, Beijing

Applicant after: QAX Technology Group Inc.

Address before: 100015 Jiuxianqiao Chaoyang District Beijing Road No. 10, building 15, floor 17, layer 1701-26, 3

Applicant before: BEIJING QIANXIN TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant