CN115599587A - Detection method and device for log collection, storage medium and electronic device - Google Patents

Detection method and device for log collection, storage medium and electronic device Download PDF

Info

Publication number
CN115599587A
CN115599587A CN202211349686.6A CN202211349686A CN115599587A CN 115599587 A CN115599587 A CN 115599587A CN 202211349686 A CN202211349686 A CN 202211349686A CN 115599587 A CN115599587 A CN 115599587A
Authority
CN
China
Prior art keywords
execution
log collection
log
collection instruction
instruction set
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.)
Pending
Application number
CN202211349686.6A
Other languages
Chinese (zh)
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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202211349686.6A priority Critical patent/CN115599587A/en
Publication of CN115599587A publication Critical patent/CN115599587A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0766Error or fault reporting or storing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3055Monitoring arrangements for monitoring the status of the computing system or of the computing system component, e.g. monitoring if the computing system is on, off, available, not available
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/32Monitoring with visual or acoustical indication of the functioning of the machine
    • G06F11/324Display of status information
    • G06F11/327Alarm or error message display
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/32Monitoring with visual or acoustical indication of the functioning of the machine
    • G06F11/324Display of status information
    • G06F11/328Computer systems status display

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Computer Hardware Design (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application discloses a log collection detection method and device, a storage medium and an electronic device, wherein the log collection detection method comprises the following steps: receiving a log collection request, wherein the log collection request is used for requesting collection of fault logs generated in a server; responding to the log collection request, and executing log collection operation corresponding to the log collection request to the server; in the process of executing the log collection operation, detecting the execution state of the log collection operation according to the execution process of the log collection operation in the server to obtain an execution state report; and under the condition of finishing the log collection operation, displaying the target fault log and the execution state report collected by the log collection operation.

Description

Detection method and device for log collection, storage medium and electronic device
Technical Field
The embodiment of the application relates to the field of computers, in particular to a log collection detection method and device, a storage medium and an electronic device.
Background
In the running process of the network equipment, the system and the service program, a log file (log) is used as an important record file for recording actions and corresponding time generated in the running process. The fault log provides a basis for follow-up operation and maintenance personnel to analyze fault reasons and optimize related programs.
At present, a BMC (Baseboard Management Controller) can be used to collect a fault log, and a user can obtain the fault log through a log collection instruction, but the obtaining process of the fault log depends on whether the log collection instruction can be correctly executed, the default log collection instruction in the prior art can always be correctly executed, and it is not considered that the fault log obtained by collecting the log collection instruction is also influenced under the condition that the log collection instruction is incorrectly executed, so that the accuracy of the collected fault log is reduced.
Aiming at the problems of low log collection accuracy and the like in the related art, an effective solution is not provided.
Disclosure of Invention
The embodiment of the application provides a log collection detection method and device, a storage medium and an electronic device, and aims to at least solve the problems that in the related art, the log collection accuracy is low and the like.
According to an embodiment of the present application, there is provided a log collection detection method, including:
receiving a log collection request, wherein the log collection request is used for requesting collection of a fault log generated in a server;
responding to the log collection request, and executing log collection operation corresponding to the log collection request to the server;
in the process of executing the log collection operation, detecting the execution state of the log collection operation according to the execution process of the log collection operation in the server to obtain an execution state report;
and under the condition that the log collection operation is completed, displaying the target fault log collected by the log collection operation and the execution status report.
Optionally, in the process of executing the log collection operation, detecting an execution state of the log collection operation according to an execution process of the log collection operation in the server, to obtain an execution state report, where the executing state report includes:
detecting an execution result of each log collection instruction set in the execution process in the process of executing the log collection operation, wherein the log collection operation comprises a plurality of log collection instruction sets executed in the execution process, and each log collection instruction set is used for collecting one fault log;
and generating the execution state report according to the corresponding relation between the execution result and the fault log.
Optionally, the detecting an execution result of each log collection instruction set in the execution process includes:
detecting an execution parameter of each log collection instruction included in each of the log collection instruction sets;
determining the execution result for each log collection instruction set according to the execution parameters.
Optionally, the determining the execution result of each log collection instruction set according to the execution parameter includes:
determining that the execution result is successful under the condition that all the execution parameters indicate that the corresponding log collection instruction completes execution;
and determining that the execution result is execution failure when at least one of the execution parameters indicates that the corresponding log collection instruction does not complete execution.
Optionally, before the determining the execution result of each log collection instruction set according to the execution parameter, the method further includes:
determining that the execution parameter indicates that the corresponding log collection instruction completes execution under the condition that the execution parameter includes a completion identifier and the execution duration included by the execution parameter is less than or equal to a target threshold;
and when the execution parameter includes a completion identifier but the execution duration included by the execution parameter is greater than a target threshold, or the execution parameter includes an incomplete identifier, determining that the execution parameter indicates that the corresponding log collection instruction is not completed to execute.
Optionally, the determining the execution result of each log collection instruction set according to the execution parameter includes:
determining the completion degree of each log collection instruction set according to the execution parameters;
under the condition that the completion degree is used for indicating that the log collection instruction completes execution, acquiring a historical log corresponding to the log collection instruction;
under the condition that the historical log is obtained, detecting the consistency between the historical log and the fault log corresponding to the log collection instruction;
and determining the execution result according to the completion degree and the consistency.
Optionally, the generating the execution status report according to the corresponding relationship between the execution result and the fault log includes:
screening out the execution result as a target execution result with corresponding relation of execution failure;
and generating the execution status report, wherein the target execution result is recorded in the execution status report, and the execution parameter of each target collection instruction in the log collection instruction set corresponding to the target execution result and the target log information corresponding to the target execution result are recorded in the log collection instruction set corresponding to the target execution result.
Optionally, the detecting an execution result of each log collection instruction set in the execution process during the execution of the log collection operation includes:
detecting an execution result of each log collection instruction set in the execution process in the process of executing the log collection operation, wherein the log collection operation comprises a plurality of log collection instruction sets executed in the execution process, and each log collection instruction set is used for collecting one fault log;
and under the condition that the execution result is detected to be failed, controlling the log collection operation to skip the currently executed log collection instruction set and continue to execute the next log collection instruction set.
Optionally, the presenting the target fault log collected by the log collection operation and the execution status report includes:
storing the target fault log and the execution status report with corresponding relation;
receiving a query request sent by a target account, wherein the query request is used for requesting to query the execution status report, and the target account comprises an account used by a maintainer of the server and/or an account used by a sender of the log collection request;
and responding to the query request, and displaying the execution status report to the target account.
According to another embodiment of the present application, there is also provided a log collection detection apparatus, including:
the system comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving a log collection request, and the log collection request is used for requesting to collect fault logs generated in a server;
the execution module is used for responding to the log collection request and executing the log collection operation corresponding to the log collection request to the server;
the detection module is used for detecting the execution state of the log collection operation according to the execution process of the log collection operation in the server in the process of executing the log collection operation to obtain an execution state report;
and the display module is used for displaying the target fault log and the execution state report which are collected by the log collection operation under the condition that the log collection operation is completed.
According to another aspect of the embodiments of the present application, there is also provided a computer-readable storage medium, in which a computer program is stored, where the computer program is configured to execute the above-mentioned log collection detection method when running.
According to another aspect of the embodiments of the present application, there is also provided an electronic apparatus, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the log collection detection method through the computer program.
In the embodiment of the application, a log collection request is received, wherein the log collection request is used for requesting collection of a fault log generated in a server; responding to the log collection request, and executing log collection operation corresponding to the log collection request to the server; in the process of executing the log collection operation, detecting the execution state of the log collection operation according to the execution process of the log collection operation in the server to obtain an execution state report; the method comprises the steps of under the condition that log collection operation is completed, displaying target fault logs and execution state reports collected through the log collection operation, namely, firstly receiving a log collection request for requesting collection of fault logs generated in a server, responding to the log collection request, executing the log collection operation corresponding to the log collection request on the server, synchronously detecting the execution state of the log collection operation according to the execution process of the log collection operation in the server in the process of executing the log collection operation, obtaining the execution state reports, achieving the purpose of monitoring the execution process of the log collection operation, finally under the condition that the log collection operation is completed, displaying the target fault logs and the execution state reports collected through the log collection operation, and judging whether the target fault logs collected through the log collection operation are accurate or not according to the execution state reports. By adopting the technical scheme, the problems of low log collection accuracy and the like in the related technology are solved, and the technical effect of improving the log collection accuracy is realized.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art to obtain other drawings without inventive exercise.
FIG. 1 is a diagram illustrating a hardware environment of a log collection detection method according to an embodiment of the present disclosure;
FIG. 2 is a flow chart of a detection method of log collection according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a log collection request according to an embodiment of the present application;
FIG. 4 is a schematic diagram of an execution status report generation according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a presentation of an execution status report according to an embodiment of the application;
FIG. 6 is a schematic diagram of a detection process of log collection according to an embodiment of the present application;
fig. 7 is a block diagram of a detection apparatus for log collection according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions of the present application better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some 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.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The method provided by the embodiment of the application can be executed in a computer terminal, a device terminal or a similar operation device. Taking the example of running on a computer terminal, fig. 1 is a schematic diagram of a hardware environment of a detection method for log collection according to an embodiment of the present application. As shown in fig. 1, the computer terminal may include one or more (only one shown in fig. 1) processors 102 (the processors 102 may include, but are not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, and in an exemplary embodiment, may also include a transmission device 106 for communication functions and an input-output device 108. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration and is not intended to limit the structure of the computer terminal. For example, the computer terminal may also include more or fewer components than shown in FIG. 1, or have a different configuration with equivalent functionality to that shown in FIG. 1 or with more functionality than that shown in FIG. 1.
The memory 104 may be used to store a computer program, for example, a software program and a module of an application software, such as a computer program corresponding to the detection method of log collection in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, so as to implement the method described above. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to a computer terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the computer terminal. In one example, the transmission device 106 includes a Network adapter (NIC) that can be connected to other Network devices via a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
In this embodiment, a log collection detection method is provided, and is applied to the computer terminal, and fig. 2 is a flowchart of a log collection detection method according to an embodiment of the present application, and as shown in fig. 2, the flowchart includes the following steps:
step S202, receiving a log collection request, wherein the log collection request is used for requesting collection of fault logs generated in a server;
step S204, responding to the log collection request, and executing the log collection operation corresponding to the log collection request to the server;
step S206, in the process of executing the log collection operation, detecting the execution state of the log collection operation according to the execution process of the log collection operation in the server to obtain an execution state report;
step S208, when the log collection operation is completed, displaying the target fault log and the execution status report collected by the log collection operation.
Through the steps, firstly, a log collection request for requesting collection of fault logs generated in a server is received, then, the log collection operation corresponding to the log collection request is executed on the server in response to the log collection request, in the process of executing the log collection operation, the execution state of the log collection operation is synchronously detected according to the execution process of the log collection operation in the server, an execution state report is obtained, the purpose of monitoring the execution process of the log collection operation is achieved, finally, under the condition that the log collection operation is completed, target fault logs collected through the log collection operation and the execution state report are displayed, and whether the target fault logs collected through the log collection operation are accurate or not can be judged according to the execution state report. By adopting the technical scheme, the problems of low log collection accuracy and the like in the related technology are solved, and the technical effect of improving the log collection accuracy is realized.
In the technical solution provided in step S202, the server may be, but not limited to, any electronic device capable of bearing the ability to respond to a service request, bear the service, and guarantee the service, and the server may provide a computing or application service for other clients (e.g., a PC (Personal Computer), a smartphone, an ATM (Automated Teller Machine), and other terminals, even a large device such as a train system, in a network). The server has high-speed CPU (Central Processing Unit) computing capability, long-time reliable operation, strong I/O (Input/Output) external data throughput capability, and better scalability, wherein the server may include, but is not limited to, a CPU, a hard disk, a memory, a system bus, and the like.
Optionally, in this embodiment, fig. 3 is a schematic diagram of a log collection request according to an embodiment of the present application, and as shown in fig. 3, a server collects fault logs in the server in a case that the server receives the log collection request, where the fault logs may be derived from, but are not limited to, three modules, including:
a module I, a historical fault log stored in a memory in a server;
a second module, which is used for collecting the device state of the electronic devices (such as fans, batteries and the like) included in the server as a fault log;
and a third module, reading the running state of the BMC corresponding to the server as a fault log.
In the technical solution provided in step S204, the log collection operation may be, but is not limited to, executing a pre-formulated log collection instruction set, where the collection manners of the log collection instruction sets for different modules (module one, module two, and module three) may be different, and for module one, the collection manner of the log collection instruction set may be to directly obtain the historical fault log stored in the memory; for the second module, the collection mode of the log collection instruction set can be to read current state data on a sensor corresponding to the electronic device; for module three, the collection mode of the log collection instruction set may be to read the current running state of the BMC.
In the technical solution provided in step S206, the log collection operation is driven by the log collection instruction set, and whether the log collection instruction set can execute normally is directly related to the execution state of the log collection operation, and the execution state of the log collection operation also affects the accuracy and the credibility of the fault log collected by the log collection operation.
In an exemplary embodiment, the execution status report may be obtained by, but is not limited to, detecting the execution status of the log collection operation according to the execution process of the log collection operation in the server during the execution of the log collection operation, in the following manner: detecting an execution result of each log collection instruction set in the execution process in the process of executing the log collection operation, wherein the log collection operation comprises a plurality of log collection instruction sets executed in the execution process, and each log collection instruction set is used for collecting one fault log; and generating the execution state report according to the corresponding relation between the execution result and the fault log.
Optionally, in this embodiment, fig. 4 is a schematic diagram of an execution status report generation according to an embodiment of the present application, and as shown in fig. 4, an execution process of the log collection operation is completed by sequentially executing a plurality of log collection instruction sets (log collection instruction set a, log collection instruction set B, \8230;, log collection instruction set N), where each log collection instruction set is used to collect one fault log, for example, the log collection instruction set a is used to collect a fault log 1, and the log collection instruction set B is used to collect a fault log 2, where each log collection instruction set includes a plurality of log collection instructions, for example, the log collection instruction set a includes: the log collection instruction A1 is log collection instruction A2, \8230;, log collection instruction An. Executing the log collection instruction set A, namely sequentially executing the log collection instruction A1, the log collection instructions A2, \8230 \ 8230:, finally acquiring a fault log (fault log 1) by the log collection instruction An, and generating the execution state report according to the corresponding relation between the execution result of the log collection instruction set and the fault log.
In an exemplary embodiment, the execution results of each log collection instruction set in the execution process may be detected, but are not limited to, by: detecting an execution parameter of each log collection instruction included in each of the log collection instruction sets; determining the execution result for each log collection instruction set according to the execution parameters.
Optionally, in this embodiment, the execution parameters may be, but are not limited to, information indicating an execution time of the log collection instruction, whether the execution is completed, and the like, each log collection instruction may correspond to one execution parameter, and an execution result of the log collection instruction set may be determined according to the execution parameters.
In one exemplary embodiment, the execution results for each log collection instruction set may be determined from the execution parameters by, but are not limited to: determining that the execution result is successful under the condition that all the execution parameters indicate that the corresponding log collection instruction completes execution; and determining that the execution result is execution failure when at least one execution parameter in the execution parameters indicates that the corresponding log collection instruction does not finish execution.
Optionally, in this embodiment, for the entire log collection instruction set, executing the log collection instruction set is equivalent to sequentially executing a plurality of log collection instructions included in the log collection instruction set, where whether the corresponding log collection instruction completes execution may be determined according to the execution parameter, and in a case that all log collection instructions included in the log collection instruction set complete execution, it may be determined that the log collection instruction set succeeds in execution, and in contrast, in a case that at least one execution parameter indicates that the corresponding log collection instruction does not complete execution, it is determined that there is an error in execution of the log collection instruction set, that is, an execution result of the log collection instruction set is an execution failure.
In an exemplary embodiment, before the determining the execution result of each log collection instruction set according to the execution parameter, the determining that the execution parameter indicates that the corresponding log collection instruction completes execution may further include, but is not limited to, determining that the execution parameter indicates that the corresponding log collection instruction completes execution if the execution parameter includes a completion flag and an execution duration included in the execution parameter is less than or equal to a target threshold; when the execution parameter includes a completion flag but an execution duration included in the execution parameter is greater than a target threshold, or when the execution parameter includes an incomplete flag, it is determined that the execution parameter indicates that the corresponding log collection instruction does not complete execution.
Optionally, in this embodiment, the execution parameter may indicate whether an error exists in the execution process of the corresponding log collection instruction, and an execution time length of the log collection instruction, so that when the execution parameter indicates that an error exists in the execution process of the corresponding log collection instruction (i.e., the above-mentioned unfinished flag), or when the log collection instruction does not respond for a long time (i.e., the above-mentioned execution time length is greater than the target threshold), it may be determined that the log collection instruction has not finished executing, and conversely, when the execution parameter indicates that an error does not exist in the execution process of the corresponding log collection instruction (i.e., the above-mentioned finished flag), or when the log collection instruction responds within a preset time (i.e., the above-mentioned execution time length is less than or equal to the target threshold), it may be determined that the log collection instruction has finished executing.
In one exemplary embodiment, the execution results for each log collection instruction set may be determined from the execution parameters by, but are not limited to: determining the completion degree of each log collection instruction set according to the execution parameters; under the condition that the completion degree is used for indicating that the log collection instruction completes execution, acquiring a history log corresponding to the log collection instruction; under the condition that the history log is obtained, detecting the consistency between the history log and the fault log corresponding to the log collection instruction; and determining the execution result according to the completion degree and the consistency.
Optionally, in this embodiment, as shown in fig. 3, a log collection instruction set is executed to collect fault logs in the server, where the fault logs may be derived from three modules, including: a module I, a historical fault log stored in a memory in a server; a second module, which is used for collecting the device state of the electronic devices (such as fans, batteries and the like) included in the server as a fault log; and a third module, reading the running state of the BMC corresponding to the server as a fault log. For the first module, since the history log is stored in the memory, the consistency between the fault log acquired by the log collection instruction and the history log stored in the memory can be compared when the log collection instruction is executed, and the execution result is further determined.
In an exemplary embodiment, the execution status report may be generated according to a correspondence relationship between the execution result and the fault log by, but not limited to: screening out the execution result as a target execution result with corresponding relation of execution failure; and generating the execution status report, wherein the target execution result is recorded in the execution status report, and the execution parameter of each target collection instruction in the log collection instruction set corresponding to the target execution result and the target log information corresponding to the target execution result are recorded in the log collection instruction set corresponding to the target execution result.
Optionally, in this embodiment, for an operation and maintenance worker, in order to analyze a process of a log collection instruction set and modify and adjust the log collection instruction set subsequently, it may be relatively concerned that an execution result is a log collection instruction set with execution failure, and therefore, a target execution result with a corresponding relationship is screened out, where the target execution result is an execution failure, where the target execution result may include 3 aspects: the execution status report records the target execution result, the execution parameter of each target collection instruction in the log collection instruction set corresponding to the target execution result, and the target log information corresponding to the target execution result.
In an exemplary embodiment, the execution result of each log collection instruction set in the execution process may be detected during the execution of the log collection operation by, but not limited to: detecting an execution result of each log collection instruction set in the execution process in the process of executing the log collection operation, wherein the log collection operation comprises a plurality of log collection instruction sets executed in the execution process, and each log collection instruction set is used for collecting one fault log; and under the condition that the execution result is detected to be the execution failure, controlling the log collection operation to skip the currently executed log collection instruction set and continue to execute the next log collection instruction set.
Alternatively, in this embodiment, as shown in fig. 4, during the execution of the log collection operation, the execution result of each log collection instruction set in the execution process is detected, for example, in a case that the execution result of the log collection instruction set a is detected as an execution failure, the log collection operation is controlled to skip the currently executed log collection instruction set to continue executing the next log collection instruction set (i.e., the log collection instruction set B).
In the technical solution provided in step S208, when the log collection operation is completed, the target fault log and the execution status report are sent or displayed to the operation and maintenance staff.
In an exemplary embodiment, the target fault log and the execution status report collected by the log collection operation may be presented, but are not limited to, by: storing the target fault log and the execution status report with a corresponding relationship; receiving a query request sent by a target account, wherein the query request is used for requesting to query the execution status report, and the target account comprises an account used by a maintainer of the server and/or an account used by a sender of the log collection request; and responding to the query request, and displaying the execution status report to the target account.
Optionally, in this embodiment, fig. 5 is a schematic diagram illustrating an execution status report according to an embodiment of the present application, and as shown in fig. 5, after the collection of the fault log in the server is completed, the target fault log and the execution status report having a corresponding relationship are stored; and the server receives a query request sent by a target account, responds to the query request and displays the execution status report to the target account.
In order to better understand the above detection process of log collection, the following describes the detection flow of log collection with reference to an optional embodiment, but the description is not limited to the technical solution of the embodiment of the present application.
In this embodiment, a method for detecting log collection is provided, and fig. 6 is a schematic diagram of a detection flow of log collection according to an embodiment of the present application, as shown in fig. 6, the method mainly includes the following steps:
step S602: starting collecting the log by one key, monitoring and managing each command (log collecting instruction set) in the collected fault log, wherein a corresponding specific command exists for the progress of collecting the fault log by one key, so that a user can check the specific condition of collecting the fault log;
step S604: sequentially executing corresponding one-key log collecting commands;
step S606: and recording corresponding results, and judging success, failure and overtime of command results and recording the command results. When failure or overtime judgment is met, the next collection command is continuously executed;
step S608: whether the historical logs are consistent with the collected fault logs is verified, and finally after the log collecting command is completely finished, the collected fault logs and the historical logs are verified and compared to ensure that the collected fault logs are correct in content;
step S610: marking the file, and if the content is inconsistent, marking the file;
step S612: after the log collection is finished by one key, maintenance personnel can judge whether the collected log is reliable or not through the recorded information, whether failure conditions exist or not, and if the failure conditions exist, the maintenance personnel can select manual collection or collection again.
It should be noted that the method according to the embodiment of the present application may monitor the progress of currently collecting the fault log, may display detailed operation information thereof, and when an unexpected error occurs during the collecting process, record an erroneous operation, and skip performing the next operation step. If the command that appears to be executed does not correspond for a long time, the command (log collection instruction set) is logged and the command is skipped for the next step. And finally, after the fault log collection is finished, verifying the collected content to avoid the situation of inconsistent content, if the content is inconsistent, marking the fault log, and then packaging and uploading the fault log to a user website (a target account). The user can check the running condition of each collection command by himself, if the command fails, the user and a technician can quickly identify the command, the user can manually collect the corresponding command again according to the failure command, the technician can quickly locate the problem reason, and the reliability and the accuracy of log collection are improved.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present application or portions thereof that contribute to the prior art may be embodied in the form of a software product, where the computer software product is stored in a storage medium (such as a ROM/RAM, a magnetic disk, and an optical disk), and includes several instructions for enabling a terminal device (which may be a mobile phone, a computer, a server, or a network device) to execute the method of the embodiments of the present application.
FIG. 7 is a block diagram of a detection apparatus for log collection according to an embodiment of the present application; as shown in fig. 7, includes:
a receiving module 702, configured to receive a log collection request, where the log collection request is used to request collection of a fault log generated in a server;
an executing module 704, configured to respond to the log collection request, and execute a log collection operation corresponding to the log collection request on the server;
a detecting module 706, configured to detect, in a process of executing the log collection operation, an execution state of the log collection operation according to an execution process of the log collection operation in the server, so as to obtain an execution state report;
a presentation module 708, configured to present the target fault log and the execution status report collected by the log collection operation when the log collection operation is completed.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are located in different processors in any combination.
According to the embodiment, firstly, a log collection request for requesting collection of fault logs generated in a server is received, then, the log collection operation corresponding to the log collection request is executed on the server in response to the log collection request, in the process of executing the log collection operation, the execution state of the log collection operation is synchronously detected according to the execution process of the log collection operation in the server, an execution state report is obtained, the purpose of monitoring the execution process of the log collection operation is achieved, finally, under the condition that the log collection operation is completed, target fault logs and the execution state report collected through the log collection operation are displayed, and whether the target fault logs collected through the log collection operation are accurate or not can be judged according to the execution state report. By adopting the technical scheme, the problems of low log collection accuracy and the like in the related technology are solved, and the technical effect of improving the log collection accuracy is realized.
In an exemplary embodiment, the detection module includes:
a first detection unit, configured to detect an execution result of each log collection instruction set in the execution process during execution of the log collection operation, where the log collection operation includes a plurality of log collection instruction sets executed in the execution process, and each log collection instruction set is used to collect one fault log;
and the generating unit is used for generating the execution state report according to the corresponding relation between the execution result and the fault log.
In an exemplary embodiment, the first detecting unit is further configured to:
detecting an execution parameter of each log collection instruction included in each of the log collection instruction sets;
determining the execution result for each log collection instruction set according to the execution parameters.
In an exemplary embodiment, the first detecting unit is further configured to:
determining that the execution result is successful when all the execution parameters indicate that the corresponding log collection instruction completes execution;
and determining that the execution result is execution failure when at least one execution parameter in the execution parameters indicates that the corresponding log collection instruction does not finish execution.
In one exemplary embodiment, the apparatus further comprises:
a first determining module, configured to, before determining the execution result of each log collection instruction set according to the execution parameter, determine that the execution parameter indicates that the corresponding log collection instruction completes execution if the execution parameter includes a completion flag and an execution duration included in the execution parameter is less than or equal to a target threshold;
a second determining module, configured to determine that the execution parameter indicates that the log collection instruction corresponding to the execution parameter does not complete execution when the execution parameter includes a completion identifier but an execution duration included in the execution parameter is greater than a target threshold, or when the execution parameter includes an incomplete identifier.
In an exemplary embodiment, the first determining module includes:
a first determining unit, configured to determine a completion degree of each log collection instruction set according to the execution parameter;
the obtaining unit is used for obtaining a history log corresponding to the log collection instruction under the condition that the completion degree is used for indicating that the log collection instruction completes execution;
the second detection unit is used for detecting the consistency between the history log and the fault log corresponding to the log collection instruction under the condition that the history log is obtained;
and the second determining unit is used for determining the execution result according to the completion degree and the consistency.
In an exemplary embodiment, the generating unit is further configured to:
screening out the execution result as a target execution result with corresponding relation of execution failure;
and generating the execution status report, wherein the target execution result is recorded in the execution status report, and the execution parameter of each target collection instruction in the log collection instruction set corresponding to the target execution result and the target log information corresponding to the target execution result are recorded in the log collection instruction set corresponding to the target execution result.
In an exemplary embodiment, the first detection unit is further configured to
Detecting an execution result of each log collection instruction set in the execution process in the process of executing the log collection operation, wherein the log collection operation comprises a plurality of log collection instruction sets executed in the execution process, and each log collection instruction set is used for collecting one fault log;
and under the condition that the execution result is detected to be the execution failure, controlling the log collection operation to skip the currently executed log collection instruction set and continue to execute the next log collection instruction set.
In an exemplary embodiment, the display module includes:
a storage unit, configured to store the target fault log and the execution status report that have a corresponding relationship;
a receiving unit, configured to receive an inquiry request sent by a target account, where the inquiry request is used to request to inquire about the execution status report, and the target account includes an account used by a maintainer of the server and/or an account used by a sender of the log collection request;
and the display unit is used for responding to the query request and displaying the execution state report to the target account.
Embodiments of the present application further provide a computer-readable storage medium having a computer program stored therein, wherein the computer program is configured to perform the steps in any of the above method embodiments when executed.
In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Embodiments of the present application further provide an electronic device comprising a memory having a computer program stored therein and a processor configured to execute the computer program to perform the steps in any of the above method embodiments.
In an exemplary embodiment, the electronic device may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary embodiments, and details of this embodiment are not repeated herein.
It will be apparent to those skilled in the art that the various modules or steps of the present application described above may be implemented using a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and they may be implemented using program code executable by the computing devices, such that they may be stored in a memory device and executed by the computing devices, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into separate integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present application is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the principle of the present application shall be included in the protection scope of the present application.

Claims (12)

1. A method for detecting log collection, comprising:
receiving a log collection request, wherein the log collection request is used for requesting collection of a fault log generated in a server;
responding to the log collection request, and executing log collection operation corresponding to the log collection request to the server;
in the process of executing the log collection operation, detecting the execution state of the log collection operation according to the execution process of the log collection operation in the server to obtain an execution state report;
and under the condition that the log collection operation is completed, displaying the target fault log collected by the log collection operation and the execution status report.
2. The method according to claim 1, wherein during the execution of the log collection operation, detecting an execution status of the log collection operation according to an execution process of the log collection operation in the server, and obtaining an execution status report, includes:
detecting an execution result of each log collection instruction set in the execution process in the process of executing the log collection operation, wherein the log collection operation comprises a plurality of log collection instruction sets executed in the execution process, and each log collection instruction set is used for collecting one fault log;
and generating the execution state report according to the corresponding relation between the execution result and the fault log.
3. The method of claim 2, wherein detecting the result of execution of each log gather instruction set in the executing process comprises:
detecting an execution parameter of each log collection instruction included in each of the log collection instruction sets;
determining the execution result of each log collection instruction set according to the execution parameters.
4. The method of claim 3, wherein determining the execution result for each log collection instruction set according to the execution parameters comprises:
determining that the execution result is successful when all the execution parameters indicate that the corresponding log collection instruction completes execution;
and determining that the execution result is execution failure when at least one execution parameter in the execution parameters indicates that the corresponding log collection instruction does not finish execution.
5. The method of claim 4, wherein prior to said determining the execution result for each log collection instruction set as a function of the execution parameters, the method further comprises:
determining that the execution parameter indicates that the corresponding log collection instruction completes execution under the condition that the execution parameter includes a completion identifier and the execution time included by the execution parameter is less than or equal to a target threshold;
and when the execution parameter includes a completion identifier but the execution duration included by the execution parameter is greater than a target threshold, or the execution parameter includes an incomplete identifier, determining that the execution parameter indicates that the corresponding log collection instruction is not completed to execute.
6. The method of claim 3, wherein determining the execution result for each log collection instruction set according to the execution parameters comprises:
determining the completion degree of each log collection instruction set according to the execution parameters;
under the condition that the completion degree is used for indicating that the log collection instruction completes execution, acquiring a history log corresponding to the log collection instruction;
under the condition that the history log is obtained, detecting the consistency between the history log and the fault log corresponding to the log collection instruction;
and determining the execution result according to the completion degree and the consistency.
7. The method of claim 3, wherein generating the execution status report according to the correspondence between the execution result and the fault log comprises:
screening out the execution result as a target execution result with corresponding relation of execution failure;
and generating the execution status report, wherein the target execution result is recorded in the execution status report, and the execution parameter of each target collection instruction in the log collection instruction set corresponding to the target execution result and the target log information corresponding to the target execution result are recorded in the log collection instruction set corresponding to the target execution result.
8. The method according to claim 2, wherein the detecting an execution result of each log collection instruction set in the execution process during the execution of the log collection operation comprises:
detecting an execution result of each log collection instruction set in the execution process in the process of executing the log collection operation, wherein the log collection operation comprises a plurality of log collection instruction sets executed in the execution process, and each log collection instruction set is used for collecting one fault log;
and under the condition that the execution result is detected to be the execution failure, controlling the log collection operation to skip the currently executed log collection instruction set and continue to execute the next log collection instruction set.
9. The method of claim 1, wherein said exposing the target fault log and the execution status report collected by the log collection operation comprises:
storing the target fault log and the execution status report with corresponding relation;
receiving an inquiry request sent by a target account, wherein the inquiry request is used for requesting to inquire the execution status report, and the target account comprises an account used by a maintainer of the server and/or an account used by a sender of the log collection request;
and responding to the query request, and displaying the execution status report to the target account.
10. A log collection detection apparatus, comprising:
the system comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving a log collection request, and the log collection request is used for requesting to collect fault logs generated in a server;
the execution module is used for responding to the log collection request and executing the log collection operation corresponding to the log collection request to the server;
a detection module, configured to detect, according to an execution process of the log collection operation in the server, an execution state of the log collection operation in a process of executing the log collection operation, and obtain an execution state report;
and the display module is used for displaying the target fault log and the execution state report which are collected by the log collection operation under the condition that the log collection operation is completed.
11. A computer-readable storage medium, comprising a stored program, wherein the program when executed performs the method of any of claims 1 to 9.
12. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method of any of claims 1 to 9 by means of the computer program.
CN202211349686.6A 2022-10-31 2022-10-31 Detection method and device for log collection, storage medium and electronic device Pending CN115599587A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211349686.6A CN115599587A (en) 2022-10-31 2022-10-31 Detection method and device for log collection, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211349686.6A CN115599587A (en) 2022-10-31 2022-10-31 Detection method and device for log collection, storage medium and electronic device

Publications (1)

Publication Number Publication Date
CN115599587A true CN115599587A (en) 2023-01-13

Family

ID=84850567

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211349686.6A Pending CN115599587A (en) 2022-10-31 2022-10-31 Detection method and device for log collection, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN115599587A (en)

Similar Documents

Publication Publication Date Title
CN107688530B (en) Software testing method and device
CN105376335B (en) Collected data uploading method and device
CN111459794A (en) Communication network testing method, device, computer equipment and storage medium
CN103530199A (en) Software running error repairing method, device and system
US20220050765A1 (en) Method for processing logs in a computer system for events identified as abnormal and revealing solutions, electronic device, and cloud server
CN110908909A (en) Automatic testing method and device, storage medium and equipment
CN110472749B (en) Remote monitoring method and monitoring equipment for equipment
CN110501956B (en) Production test alarm system, server and alarm information acquisition equipment
CN111273573A (en) Environmental data monitoring method and device
CN110752954A (en) Networking fault detection method and related device for household electrical appliance
CN111464376A (en) Website availability monitoring method and device, storage medium and computer equipment
CN111224815A (en) Data center equipment access method, device and related components
CN108307414B (en) Wi-Fi connection abnormity processing method and device of application program, terminal and storage medium
CN110888782B (en) Device processing method, system, electronic device and computer readable storage medium
CN117411804A (en) Server network testing method and device, electronic equipment and storage medium
CN110069382B (en) Software monitoring method, server, terminal device, computer device and medium
CN116504039A (en) Abnormality identification method and device for indoor equipment and electronic equipment
CN115599587A (en) Detection method and device for log collection, storage medium and electronic device
CN112600715B (en) Distribution network operation analysis method and device, storage medium and electronic device
CN113923145A (en) Server network card automatic test method and device and electronic equipment
CN110134558B (en) Method and device for detecting server
CN109032869B (en) Portable server hardware test terminal
CN112486773A (en) Data processing method, device and system
CN113489708B (en) Detection method and device, electronic equipment and computer readable storage medium
WO2023226601A1 (en) Anomaly processing method and apparatus for heterogeneous acceleration resource, and storage medium and electronic apparatus

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