Server project operation condition determination method and device and storage medium
Through timed task execution detection scripts and data acquisition technology, the server project operation status is monitored in real time, and automatically activates and issues alarms, which solves the time and cost problems when server projects are suspended or crashed in the existing technology, and realizes the persistent operation of the project and quick troubleshooting.
Patent Information
- Application Number
- CN202411153987.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2024-11-22
AI Technical Summary
In the prior art, when a server project suddenly stops or crashes unexpectedly, personnel are required to go to the site to restart, resulting in high time and labor costs, and the project cannot be started by itself, and it is impossible to intuitively confirm whether all the projects are started normally. The query process consumes a lot of money. time.
Provide a method to determine the operation status of a server project. By obtaining a timed task execution detection script, detecting the operation status of the server project, collecting operation data based on the operation status, determining the operation status of the project within the preset time, and performing it through a visual page. show. This method includes using a timed task execution detection script to detect the existence of the port, collecting operation data, configuring Prometheus and Granfana files, monitoring the operation of the project in real time, automatically activate the project and issue alarm information.
Real-time monitoring of project operation status, timely discover the causes of unexpected crashes, ensure the project's persistent operation, solve the problem of inability to intuitively confirm the normal start of the project, and save time and labor costs.
Smart Images

Figure CN119003293A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of server project operation, and in particular, to a method for determining the operation status of a server project, an apparatus for determining the operation status of a server project, a computer-readable storage medium, and an electronic device. Background Art
[0002] As server projects are deployed in more and more environments, traditional server projects experience sudden stops or unexpected crashes, requiring personnel to go to the site to restart the project, which greatly wastes time and manpower costs, and makes it impossible for the project to start on its own and ensure persistent operation. Summary of the invention
[0003] The main purpose of the present application is to provide a method for determining the operation status of a server project, a device for determining the operation status of a server project, a computer-readable storage medium and an electronic device, so as to at least solve the problem in the prior art that it is impossible to intuitively confirm whether all server projects have been started normally, and it takes a lot of time to query whether the project has been started.
[0004] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a method for determining the operation status of a server project is provided, comprising: obtaining a scheduled task execution detection script, wherein the scheduled task execution detection script is used to detect the operation status of the server project, and the operation status of the server project includes being running or stopped; using the scheduled task execution detection script to detect the operation status of the server project, and according to the operation status of the server project, collecting operation data corresponding to the server project in each operation status; according to the operation status of the server project and the corresponding operation data, determining the operation status of the server project within a preset time, and displaying the operation status of the server project within the preset time through a visualization page.
[0005] Optionally, using the scheduled task to execute a detection script to detect the running status of the server project includes: using the scheduled task to execute a detection script to detect whether a running port of the server project exists at the current moment; if the running port of the server project exists at the current moment, determining that the running status of the server project is running; if the running port of the server project does not exist at the current moment, determining that the running status of the server project is stopped.
[0006] Optionally, the scheduled task is used to execute a detection script to detect the running status of the server project, and according to the running status of the server project, the running data corresponding to the server project in each running status is collected, including: uploading an initial node_exporter file, and decompressing the initial node_exporter file to obtain a node_exporter file; starting a startup script corresponding to the node_exporter file, and using the collector.textfile function in the node_exporter file to perform customized monitoring of the running status of the server project and the corresponding running data, to obtain the running status of the server project and the corresponding running data.
[0007] Optionally, according to the running status of the server project and the corresponding running data, the running status of the server project within a preset time is determined, and the running status of the server project within the preset time is displayed through a visualization page, including: uploading an initial Prometheus file, and decompressing the initial Prometheus file to obtain a Prometheus file; configuring the connection port between the node_exporter and the Prometheus file, and saving the running status of the server project and the corresponding running data from the node_exporter to the Prometheus file through the connection port; uploading an initial Granfana file, and The initial Granfana file is decompressed to obtain a Granfana file; a Prometheus panel is created in the Granfana file, and a Prometheus name and a Prometheus address corresponding to the Prometheus file are configured in the Prometheus panel; according to the Prometheus name and the Prometheus address, the running status of the server project in the Prometheus file and the corresponding running data are imported into the Granfana file, and the running status of the server project within a preset time is determined, so as to display the running status of the server project within the preset time through a visualization page.
[0008] Optionally, after using the scheduled task to execute the detection script to detect the running status of the server project, the method also includes: automatically activating the server project when the running status of the server project is stopped at the current moment; continuously monitoring the running status of the server project, and when the running status of the server project is still stopped, continuously activating the server project until the running status of the server project is running or the maximum number of activation times is reached.
[0009] Optionally, the method further includes: when the running status of the server project is stopped at the current moment, issuing a first alarm message, the first alarm message indicating that the running status of the server project is stopped for the first time; when the number of activations of the server project reaches the maximum number of activations and the server project is still in the stopped state, issuing a second alarm message, the second alarm message indicating that the server project cannot be automatically activated.
[0010] Optionally, obtaining a scheduled task execution detection script includes: obtaining a detection period, the detection period being the interval between two adjacent detections of the server project by the scheduled task execution detection script; obtaining projects to be detected, the projects to be detected including at least one of the server projects; and configuring the scheduled task execution detection script according to the detection period and the projects to be detected.
[0011] According to another aspect of the present application, a device for determining the running status of a server project is provided, comprising: an acquisition unit, used to acquire a scheduled task execution detection script, wherein the scheduled task execution detection script is used to detect the running status of the server project, wherein the running status of the server project includes being running or stopped; a collection unit, used to detect the running status of the server project using the scheduled task execution detection script, and according to the running status of the server project, collect the corresponding running data of the server project under each running status; a determination unit, used to determine the running status of the server project within a preset time according to the running status of the server project and the corresponding running data, and display the running status of the server project within the preset time through a visualization page.
[0012] According to another aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute any one of the methods for determining the operation status of a server project.
[0013] According to another aspect of the present application, an electronic device is provided, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include a method for determining the operating status of any one of the above-mentioned server projects.
[0014] Applying the technical solution of the present application, the method for determining the operation status of the above-mentioned server project first obtains a scheduled task execution detection script, which is used to detect the operation status of the server project, and the operation status of the server project includes running or stopping; then the scheduled task execution detection script is used to detect the operation status of the server project, and according to the operation status of the server project, the corresponding operation data of the server project in each operation status is collected; finally, according to the operation status of the server project and the corresponding operation data, the operation status of the server project within the preset time is determined, and the operation status of the server project within the preset time is displayed through a visualization page. The method collects corresponding indicators through the monitoring platform, can monitor the operation status of the project in real time, whether the project is automatically running, query the cause of the accidental crash of the project, and ensure the persistent operation of the project, which solves the problem that it is impossible to intuitively confirm whether all server projects are started normally in the prior art, and it takes a lot of time to query whether the project is started. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The drawings constituting part of the present application are used to provide a further understanding of the present application. The exemplary embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0016] Figure 1 A hardware structure block diagram of a mobile terminal for executing a method for determining the running status of a server project provided in an embodiment of the present application is shown;
[0017] Figure 2 A flow chart of a method for determining the operation status of a server project provided according to an embodiment of the present application is shown;
[0018] Figure 3 A flow chart of another method for determining the operation status of a server project provided according to an embodiment of the present application is shown;
[0019] Figure 4 A structural block diagram of a device for determining the operation status of a server project provided according to an embodiment of the present application is shown.
[0020] The above drawings include the following reference numerals:
[0021] 102, processor; 104, memory; 106, transmission device; 108, input and output devices. DETAILED DESCRIPTION
[0022] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0023] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0025] As introduced in the background technology, in the prior art, when a traditional server project suddenly stops or crashes unexpectedly, personnel need to go to the site to restart the project, which greatly wastes time and manpower costs, and cannot allow the project to start by itself to ensure the persistent operation of the project. In order to solve the problem in the prior art that it is impossible to intuitively confirm whether all server projects have started normally, and it takes a lot of time to query whether the project has started, the embodiments of the present application provide a method for determining the operation status of a server project, a device for determining the operation status of a server project, a computer-readable storage medium and an electronic device.
[0026] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0027] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal of a method for determining the operation status of a server project according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0028] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for determining the operation status of the server project in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the above method is implemented. The memory 104 may include a high-speed random access memory, and may also include a 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 a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. The transmission device 106 is used to receive or send data via a network. The above-mentioned specific examples of the network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as 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 wirelessly.
[0029] In this embodiment, a method for determining the operation status of a server project running on a mobile terminal, a computer terminal or a similar computing device is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0030] Figure 21 is a flow chart of a method for determining the operation status of a server project according to an embodiment of the present application. Figure 2 As shown, the method comprises the following steps:
[0031] Step S201, obtaining a scheduled task execution detection script, wherein the scheduled task execution detection script is used to detect the running status of the server project, and the running status of the server project includes running or stopped running;
[0032] Specifically, use the scheduled task to execute the detection script to check the running project process. The scheduled task performs a detection every five minutes to check whether the current project port exists. The non-existence of the port represents the project running terminal. The current project will be automatically started and the running result will be entered into the .prom file. The running result indicates whether the project is active.
[0033] Among them, obtaining the scheduled task execution detection script includes the following steps:
[0034] Step S301, obtaining a detection period, where the detection period is the interval between two consecutive detections of the server project by the scheduled task executing the detection script;
[0035] Step S302, obtaining a project to be detected, wherein the project to be detected includes at least one of the server projects mentioned above;
[0036] Step S303: According to the detection cycle and the items to be detected, the scheduled task execution detection script is configured.
[0037] Specifically, in this way, a suitable detection cycle can be configured, so that whether the server project stops running can be found in time, and the detection resources of the system can be saved. Generally, the detection cycle can be set to five minutes or ten minutes.
[0038] In some instances, first install the scheduled task environment on the server, and then run service crond status to view the scheduled task service status. If the scheduled task process is returned, it means that the scheduled task is running normally. Enter the command crontab -e to enter the scheduled task execution instruction, and then run :wq to save it. The console outputs "crontab: installing new crontab", indicating that the task has been added successfully. Enter the command crontab -l to view the scheduled task currently being executed.
[0039] After using the scheduled task execution detection script to detect the running status of the server project, the method further includes the following steps:
[0040] Step S401, automatically activating the server project when the running state of the server project is stopped at the current moment;
[0041] Step S402, continuously monitoring the running status of the server project, and when the running status of the server project is still the stopped running, continuously activating the server project until the running status of the server project is running or the maximum activation times are reached.
[0042] Specifically, this can automatically try to activate the server project first to ensure the persistent operation of the project.
[0043] The above method further comprises the following steps:
[0044] Step S501, when the running state of the server project is stopped at the current moment, a first alarm message is issued, wherein the first alarm message indicates that the running state of the server project is stopped for the first time;
[0045] Step S502: When the number of activations of the server project reaches the maximum number of activations and the server project is still in the stopped state, a second alarm message is issued, wherein the second alarm message indicates that the server project cannot be automatically activated.
[0046] Specifically, this can issue corresponding alarms for unexpected situations, allowing business personnel to monitor the status of server projects in a timely manner and handle them in a timely manner.
[0047] Step S202, using the scheduled task execution detection script to detect the running status of the server project, and according to the running status of the server project, collecting the running data corresponding to the server project in each running status;
[0048] Specifically, execute the script to check whether the server project is running. If the project is not executed, execute the project. Node_exporter customizes the collection of server project execution status, and prometheus collects node_exporter indicator information.
[0049] Among them, using the above-mentioned scheduled task to execute the detection script to detect the running status of the above-mentioned server project includes the following steps:
[0050] Step S601, using the above-mentioned scheduled task execution detection script to detect whether the running port of the above-mentioned server project exists at the current moment;
[0051] Step S602, if the running port of the server project exists at the current moment, determining that the running state of the server project is running;
[0052] Step S603: if the running port of the server project does not exist at the current moment, determine that the running state of the server project is stopped.
[0053] Specifically, this can accurately determine the operating status of the server project.
[0054] The method of using the scheduled task to execute the detection script to detect the running status of the server project and collecting the running data corresponding to the server project in each running status according to the running status of the server project includes the following steps:
[0055] Step S701, uploading an initial node_exporter file, and decompressing the initial node_exporter file to obtain a node_exporter file;
[0056] Step S702, start the startup script corresponding to the node_exporter file, and use the collector.textfile function in the node_exporter file to perform customized monitoring on the running status and corresponding running data of the server project to obtain the running status and corresponding running data of the server project.
[0057] Specifically, this can achieve customized monitoring of server projects, ensure the persistent operation of projects, avoid unexpected interruptions of projects, and through the monitoring system, view the operation status of projects in real time and issue corresponding alarms for unexpected situations.
[0058] In some instances, upload the node_exporter file, decompress the node_exporter file, enter the decompressed folder, execute the startup script, and add: --collextor.textfile.directory={path} after executing the startup script. Use the collector.textfile function of node_exporter to customize monitoring, where {path} is the path of the .prom running result file. After successful execution, enter http: / / ip+port / metrics in the browser to view the node_exporter collection data.
[0059] Step S203, determining the operation status of the server project within a preset time according to the operation status of the server project and the corresponding operation data, and displaying the operation status of the server project within the preset time through a visualization page.
[0060] Specifically, use shell scripts to check whether the project is running. If it is not running, execute the project running instructions and enter the current execution status into the log. The project uses node_exporter to customize the collection indicators, collect the running status of the project in the log, configure the node_exporter environment through Prometheus, and display the collected custom indicator data in granfana. Collect data for custom collection indicators on the monitoring platform, analyze the collected data, and issue alarms for problematic data.
[0061] According to the operation status of the server project and the corresponding operation data, the operation status of the server project within a preset time is determined, and the operation status of the server project within the preset time is displayed through a visualization page, including the following steps:
[0062] Step S801, upload the initial Prometheus file, and decompress the initial Prometheus file to obtain the Prometheus file;
[0063] Step S802, configuring the connection port of the node_exporter and the Prometheus file, and saving the running status of the server project and the corresponding running data from the node_exporter to the Prometheus file through the connection port;
[0064] Step S803, uploading the initial Granfana file, and decompressing the initial Granfana file to obtain the Granfana file;
[0065] Step S804, creating a Prometheus panel in the Granfana file, and configuring the Prometheus name and Prometheus address corresponding to the Prometheus file in the Prometheus panel;
[0066] Step S805: According to the Prometheus name and the Prometheus address, the running status of the server project in the Prometheus file and the corresponding running data are imported into the Granfana file, and the running status of the server project within the preset time is determined, so as to display the running status of the server project within the preset time through a visualization page.
[0067] Specifically, the shell script is executed to ensure that the project can run persistently, and the corresponding indicators are collected through the monitoring platform. It is possible to monitor the project operation status in real time, whether the project is running automatically, query the cause of the project's unexpected crash, and ensure the project's persistent operation.
[0068] In some instances, upload the Prometheus file, decompress the Prometheus file, enter the decompressed folder, open prometheus.yml, configure the node_exporter ip+port to Prometheus.yml for collection, save the configuration file and start Prometheus, access the deployed prometheus in the browser: http: / / ip+port, click Status->Targets in the menu bar, and see the following node on the page, indicating that Prometheus and node_exporter are connected successfully.
[0069] In other instances, upload the Granfana file, unzip the Granfana file, enter the unzipped folder, start granfana: systemctl start granfana-server, access the browser: http: / / ip+port, the first login username / password defaults to: admin / admin, you can change it yourself. Create a prometheus panel: select prometheus to add, set the name and url address of prometheus, create the required Dashboards, import the dashboard, (search for Node Export on the official Dashboard website and select the corresponding DashBoardID on this page) to create it.
[0070] In other instances, the monitoring platform is used to collect project operation results. If the project is restarted, the system issues a corresponding alarm. The operation and maintenance personnel inquire about the cause of the project interruption and manually restore the alarm information.
[0071] The method for determining the operation status of the above-mentioned server project of the present application first obtains a scheduled task execution detection script, which is used to detect the operation status of the server project, and the operation status of the server project includes being running or stopped; then the scheduled task execution detection script is used to detect the operation status of the server project, and according to the operation status of the server project, the corresponding operation data of the server project under each operation status is collected; finally, according to the operation status of the server project and the corresponding operation data, the operation status of the server project within a preset time is determined, and the operation status of the server project within the preset time is displayed through a visualization page. The method collects corresponding indicators through the monitoring platform, can monitor the operation status of the project in real time, whether the project is automatically running, query the cause of the accidental crash of the project, and ensure the persistent operation of the project, which solves the problem that it is impossible to intuitively confirm whether all server projects are started normally in the prior art, and it takes a lot of time to query whether the project is started.
[0072] In order to enable those skilled in the art to more clearly understand the technical solution of the present application, the implementation process of the method for determining the operation status of a server project of the present application will be described in detail below in conjunction with specific embodiments.
[0073] This embodiment relates to a specific method for determining the operation status of a server project, such as Figure 3 As shown, the following steps are included:
[0074] Step S1: Execute the script to check whether the server project is running. If the project is not running, continue to execute the script for detection;
[0075] Step S2: When the server project is running, node_exporter customizes the collection of server project execution status;
[0076] Step S3: prometheus collects node_exporter indicator information;
[0077] Step S4: The information in Prometheus is visualized through Granfana, and the operation data of the server project is collected through the monitoring platform. If the project is restarted, the system will issue a corresponding alarm.
[0078] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0079] The embodiment of the present application also provides a device for determining the operation status of a server project. It should be noted that the device for determining the operation status of a server project in the embodiment of the present application can be used to execute the method for determining the operation status of a server project provided in the embodiment of the present application. The device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions thereof will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0080] The following introduces the device for determining the operation status of a server project provided in an embodiment of the present application.
[0081] Figure 4 Schematic diagram of a device for determining the operation status of a server project according to an embodiment of the present application. Figure 4 As shown, the device includes: an acquisition unit 10, a collection unit 20, and a determination unit 30. The acquisition unit 10 is used to acquire a scheduled task execution detection script, and the scheduled task execution detection script is used to detect the running status of the server project. The running status of the server project includes running or stopped running; the collection unit 20 is used to use the scheduled task execution detection script to detect the running status of the server project, and according to the running status of the server project, collect the corresponding running data of the server project in each of the above running states; the determination unit 30 is used to determine the running status of the server project within a preset time according to the running status of the server project and the corresponding running data, and display the running status of the server project within the preset time through a visualization page.
[0082] The above-mentioned device for determining the operation status of the server project of the present application includes: an acquisition unit, a collection unit, and a determination unit. The acquisition unit is used to acquire a scheduled task execution detection script, and the scheduled task execution detection script is used to detect the operation status of the server project. The operation status of the server project includes running or stopping; the collection unit is used to detect the operation status of the server project using the scheduled task execution detection script, and according to the operation status of the server project, collect the corresponding operation data of the server project in each operation status; the determination unit is used to determine the operation status of the server project within a preset time according to the operation status of the server project and the corresponding operation data, and display the operation status of the server project within the preset time through a visualization page. The device collects corresponding indicators through a monitoring platform, can monitor the operation status of the project in real time, whether the project is automatically running, query the cause of the accidental crash of the project, and ensure the persistent operation of the project, which solves the problem that it is impossible to intuitively confirm whether all server projects are started normally in the prior art, and it takes a lot of time to query whether the project is started.
[0083] In some examples, the acquisition unit includes a first detection module, a first determination module, and a second determination module. The first detection module is used to use the above-mentioned scheduled task execution detection script to detect whether the running port of the above-mentioned server project exists at the current moment; the first determination module is used to determine that the running state of the above-mentioned server project is running if the running port of the above-mentioned server project exists at the current moment; the second determination module is used to determine that the running state of the above-mentioned server project is stopped if the running port of the above-mentioned server project does not exist at the current moment. In this way, the running state of the server project can be accurately determined.
[0084] In some instances, the collection unit includes a first processing module and a second processing module, the first processing module is used to upload the initial node_exporter file and decompress the initial node_exporter file to obtain the node_exporter file; the second processing module is used to start the startup script corresponding to the node_exporter file, and use the collector.textfile function in the node_exporter file to perform custom monitoring on the running status and corresponding running data of the server project to obtain the running status and corresponding running data of the server project. In this way, custom monitoring of the server project can be achieved, ensuring the persistent operation of the project, avoiding accidental interruption of the project, and through the monitoring system, real-time viewing of the running status of the project, and corresponding alarms for unexpected situations.
[0085] In some instances, the determination unit includes a third processing module, a fourth processing module, a fifth processing module, a sixth processing module, and a seventh processing module. The third processing module is used to upload an initial Prometheus file and decompress the initial Prometheus file to obtain the Prometheus file; the fourth processing module is used to configure the connection port of the node_exporter and the Prometheus file, and save the running status of the server project and the corresponding running data from the node_exporter to the Prometheus file through the connection port; the fifth processing module is used to upload an initial Granfana file and decompress the initial Granfana file. Decompress the line to obtain the Granfana file; the sixth processing module is used to create a Prometheus panel in the above Granfana file, and configure the Prometheus name and Prometheus address corresponding to the above Prometheus file in the above Prometheus panel; the seventh processing module is used to import the running status of the above server project in the above Prometheus file and the corresponding running data into the Granfana file according to the above Prometheus name and the above Prometheus address, and determine the running status of the above server project within the preset time, so as to display the running status of the above server project within the preset time through a visualization page. Through the execution of shell scripts, it is ensured that the project can be persistently run, and the corresponding indicators are collected through the monitoring platform, so that the project operation can be monitored in real time, whether the project is automatically run, and the cause of the accidental crash of the project can be queried, and the project can be persistently run.
[0086] In some examples, after using the above-mentioned scheduled task execution detection script to detect the running status of the above-mentioned server project, the above-mentioned device also includes a first activation module and a first monitoring module. The first activation module is used to automatically activate the above-mentioned server project when the running status of the above-mentioned server project is stopped at the current moment; the first monitoring module is used to continuously monitor the running status of the above-mentioned server project, and when the running status of the above-mentioned server project is still stopped, continuously activate the above-mentioned server project until the running status of the above-mentioned server project is running or the maximum activation times are reached. In this way, the server project can be automatically tried to be activated first to ensure the persistent operation of the project.
[0087] In some examples, the device further includes an eighth processing module and a ninth processing module. The eighth processing module is used to issue a first alarm message when the running state of the server project is stopped at the current moment. The first alarm message indicates that the running state of the server project is stopped for the first time. The ninth processing module is used to issue a second alarm message when the number of activations of the server project reaches the maximum number of activations and the server project is still stopped. The second alarm message indicates that the server project cannot be automatically activated. In this way, corresponding alarms can be issued for unexpected situations, so that business personnel can monitor the status of the server project in a timely manner and handle it in a timely manner.
[0088] In some examples, the acquisition unit includes a first acquisition module, a second acquisition module and a first configuration module. The first acquisition module is used to acquire a detection cycle, which is the interval between two adjacent detections of the server project by the scheduled task execution detection script; the second acquisition module is used to acquire the project to be detected, which includes at least one of the server projects; the first configuration module is used to configure the scheduled task execution detection script according to the detection cycle and the project to be detected. In this way, a suitable detection cycle can be configured, which can timely detect whether the server project has stopped running, and can save system detection resources.
[0089] The apparatus for determining the operation status of the server project includes a processor and a memory. The acquisition unit and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions. The modules are all located in the same processor; or, the modules are located in different processors in any combination.
[0090] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and the kernel parameters can be adjusted to solve the problem in the prior art that it is impossible to intuitively confirm whether all server projects are started normally, and it takes a lot of time to query whether the project is started.
[0091] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0092] An embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method for determining the operation status of the server project.
[0093] Specifically, the method for determining the operation status of the server project includes:
[0094] Step S201, obtaining a scheduled task execution detection script, wherein the scheduled task execution detection script is used to detect the running status of the server project, and the running status of the server project includes running or stopped running;
[0095] Specifically, use the scheduled task to execute the detection script to check the running project process. The scheduled task performs a detection every five minutes to check whether the current project port exists. The non-existence of the port represents the project running terminal. The current project will be automatically started and the running result will be entered into the .prom file. The running result indicates whether the project is active.
[0096] Step S202, using the scheduled task execution detection script to detect the running status of the server project, and according to the running status of the server project, collecting the running data corresponding to the server project in each running status;
[0097] Specifically, execute the script to check whether the server project is running. If the project is not executed, execute the project. Node_exporter customizes the collection of server project execution status, and prometheus collects node_exporter indicator information.
[0098] Step S203, determining the operation status of the server project within a preset time according to the operation status of the server project and the corresponding operation data, and displaying the operation status of the server project within the preset time through a visualization page.
[0099] Specifically, use shell scripts to check whether the project is running. If it is not running, execute the project running instructions and enter the current execution status into the log. The project uses node_exporter to customize the collection indicators, collect the running status of the project in the log, configure the node_exporter environment through Prometheus, and display the collected custom indicator data in granfana. Collect data for custom collection indicators on the monitoring platform, analyze the collected data, and issue alarms for problematic data.
[0100] Optionally, the above-mentioned scheduled task execution detection script is used to detect the running status of the above-mentioned server project, including: using the above-mentioned scheduled task execution detection script to detect whether the running port of the above-mentioned server project exists at the current moment; when the running port of the above-mentioned server project exists at the current moment, determining that the running status of the above-mentioned server project is running; when the running port of the above-mentioned server project does not exist at the current moment, determining that the running status of the above-mentioned server project is stopped.
[0101] Optionally, the above-mentioned scheduled task execution detection script is used to detect the running status of the above-mentioned server project, and according to the running status of the above-mentioned server project, the corresponding running data of the above-mentioned server project in each of the above-mentioned running states is collected, including: uploading the initial node_exporter file, and decompressing the above-mentioned initial node_exporter file to obtain the node_exporter file; starting the startup script corresponding to the above-mentioned node_exporter file, and using the collector.textfile function in the above-mentioned node_exporter file to perform customized monitoring of the running status and corresponding running data of the above-mentioned server project, and obtaining the running status of the above-mentioned server project and the corresponding running data.
[0102] Optionally, according to the running status of the server project and the corresponding running data, the running status of the server project within a preset time is determined, and the running status of the server project within the preset time is displayed through a visualization page, including: uploading an initial Prometheus file, and decompressing the initial Prometheus file to obtain a Prometheus file; configuring the connection port between the node_exporter and the Prometheus file, and saving the running status of the server project and the corresponding running data from the node_exporter to the Prometheus file through the connection port; uploading an initial Granfana file, and The initial Granfana file is decompressed to obtain a Granfana file; a Prometheus panel is created in the Granfana file, and a Prometheus name and a Prometheus address corresponding to the Prometheus file are configured in the Prometheus panel; according to the Prometheus name and the Prometheus address, the running status of the server project in the Prometheus file and the corresponding running data are imported into the Granfana file, and the running status of the server project within a preset time is determined, so as to display the running status of the server project within the preset time through a visualization page.
[0103] Optionally, after using the above-mentioned scheduled task to execute the detection script to detect the running status of the above-mentioned server project, the above-mentioned method also includes: when the running status of the above-mentioned server project is stopped at the current moment, automatically activating the above-mentioned server project; continuously monitoring the running status of the above-mentioned server project, and when the running status of the above-mentioned server project is still the above-mentioned stopped running, continuously activating the above-mentioned server project until the running status of the above-mentioned server project is running or the maximum number of activation times is reached.
[0104] Optionally, the method further includes: when the running status of the server project is stopped at the current moment, issuing a first alarm message, the first alarm message indicating that the running status of the server project is stopped for the first time; when the number of activations of the server project reaches the maximum number of activations and the server project is still in the stopped state, issuing a second alarm message, the second alarm message indicating that the server project cannot be automatically activated.
[0105] Optionally, obtaining a scheduled task execution detection script includes: obtaining a detection period, the detection period being the interval between two adjacent detections of the server project by the scheduled task execution detection script; obtaining projects to be detected, the projects to be detected including at least one of the server projects; and configuring the scheduled task execution detection script according to the detection period and the projects to be detected.
[0106] An embodiment of the present invention provides a processor, and the processor is used to run a program, wherein the method for determining the running status of the server project is executed when the program is running.
[0107] Specifically, the method for determining the operation status of the server project includes:
[0108] Step S201, obtaining a scheduled task execution detection script, wherein the scheduled task execution detection script is used to detect the running status of the server project, and the running status of the server project includes running or stopped running;
[0109] Specifically, use the scheduled task to execute the detection script to check the running project process. The scheduled task performs a detection every five minutes to check whether the current project port exists. The non-existence of the port represents the project running terminal. The current project will be automatically started and the running result will be entered into the .prom file. The running result indicates whether the project is active.
[0110] Step S202, using the scheduled task execution detection script to detect the running status of the server project, and according to the running status of the server project, collecting the running data corresponding to the server project in each running status;
[0111] Specifically, execute the script to check whether the server project is running. If the project is not executed, execute the project. Node_exporter customizes the collection of server project execution status, and prometheus collects node_exporter indicator information.
[0112] Step S203, determining the operation status of the server project within a preset time according to the operation status of the server project and the corresponding operation data, and displaying the operation status of the server project within the preset time through a visualization page.
[0113] Specifically, use shell scripts to check whether the project is running. If it is not running, execute the project running instructions and enter the current execution status into the log. The project uses node_exporter to customize the collection indicators, collect the running status of the project in the log, configure the node_exporter environment through Prometheus, and display the collected custom indicator data in granfana. Collect data for custom collection indicators on the monitoring platform, analyze the collected data, and issue alarms for problematic data.
[0114] Optionally, the above-mentioned scheduled task execution detection script is used to detect the running status of the above-mentioned server project, including: using the above-mentioned scheduled task execution detection script to detect whether the running port of the above-mentioned server project exists at the current moment; when the running port of the above-mentioned server project exists at the current moment, determining that the running status of the above-mentioned server project is running; when the running port of the above-mentioned server project does not exist at the current moment, determining that the running status of the above-mentioned server project is stopped.
[0115] Optionally, the above-mentioned scheduled task execution detection script is used to detect the running status of the above-mentioned server project, and according to the running status of the above-mentioned server project, the corresponding running data of the above-mentioned server project in each of the above-mentioned running states is collected, including: uploading the initial node_exporter file, and decompressing the above-mentioned initial node_exporter file to obtain the node_exporter file; starting the startup script corresponding to the above-mentioned node_exporter file, and using the collector.textfile function in the above-mentioned node_exporter file to perform customized monitoring of the running status and corresponding running data of the above-mentioned server project, and obtaining the running status of the above-mentioned server project and the corresponding running data.
[0116] Optionally, according to the running status of the server project and the corresponding running data, the running status of the server project within a preset time is determined, and the running status of the server project within the preset time is displayed through a visualization page, including: uploading an initial Prometheus file, and decompressing the initial Prometheus file to obtain a Prometheus file; configuring the connection port between the node_exporter and the Prometheus file, and saving the running status of the server project and the corresponding running data from the node_exporter to the Prometheus file through the connection port; uploading an initial Granfana file, and The initial Granfana file is decompressed to obtain a Granfana file; a Prometheus panel is created in the Granfana file, and a Prometheus name and a Prometheus address corresponding to the Prometheus file are configured in the Prometheus panel; according to the Prometheus name and the Prometheus address, the running status of the server project in the Prometheus file and the corresponding running data are imported into the Granfana file, and the running status of the server project within a preset time is determined, so as to display the running status of the server project within the preset time through a visualization page.
[0117] Optionally, after using the above-mentioned scheduled task to execute the detection script to detect the running status of the above-mentioned server project, the above-mentioned method also includes: when the running status of the above-mentioned server project is stopped at the current moment, automatically activating the above-mentioned server project; continuously monitoring the running status of the above-mentioned server project, and when the running status of the above-mentioned server project is still the above-mentioned stopped running, continuously activating the above-mentioned server project until the running status of the above-mentioned server project is running or the maximum number of activation times is reached.
[0118] Optionally, the method further includes: when the running status of the server project is stopped at the current moment, issuing a first alarm message, the first alarm message indicating that the running status of the server project is stopped for the first time; when the number of activations of the server project reaches the maximum number of activations and the server project is still in the stopped state, issuing a second alarm message, the second alarm message indicating that the server project cannot be automatically activated.
[0119] Optionally, obtaining a scheduled task execution detection script includes: obtaining a detection period, the detection period being the interval between two adjacent detections of the server project by the scheduled task execution detection script; obtaining projects to be detected, the projects to be detected including at least one of the server projects; and configuring the scheduled task execution detection script according to the detection period and the projects to be detected.
[0120] An embodiment of the present invention provides a device, the device including a processor, a memory, and a program stored in the memory and executable on the processor, and when the processor executes the program, at least the following steps are implemented:
[0121] Step S201, obtaining a scheduled task execution detection script, wherein the scheduled task execution detection script is used to detect the running status of the server project, and the running status of the server project includes running or stopped running;
[0122] Step S202, using the scheduled task execution detection script to detect the running status of the server project, and according to the running status of the server project, collecting the running data corresponding to the server project in each running status;
[0123] Step S203, determining the operation status of the server project within a preset time according to the operation status of the server project and the corresponding operation data, and displaying the operation status of the server project within the preset time through a visualization page.
[0124] Optionally, the above-mentioned scheduled task execution detection script is used to detect the running status of the above-mentioned server project, including: using the above-mentioned scheduled task execution detection script to detect whether the running port of the above-mentioned server project exists at the current moment; when the running port of the above-mentioned server project exists at the current moment, determining that the running status of the above-mentioned server project is running; when the running port of the above-mentioned server project does not exist at the current moment, determining that the running status of the above-mentioned server project is stopped.
[0125] Optionally, the above-mentioned scheduled task execution detection script is used to detect the running status of the above-mentioned server project, and according to the running status of the above-mentioned server project, the corresponding running data of the above-mentioned server project in each of the above-mentioned running states is collected, including: uploading the initial node_exporter file, and decompressing the above-mentioned initial node_exporter file to obtain the node_exporter file; starting the startup script corresponding to the above-mentioned node_exporter file, and using the collector.textfile function in the above-mentioned node_exporter file to perform customized monitoring of the running status and corresponding running data of the above-mentioned server project, and obtaining the running status of the above-mentioned server project and the corresponding running data.
[0126] Optionally, according to the running status of the server project and the corresponding running data, the running status of the server project within a preset time is determined, and the running status of the server project within the preset time is displayed through a visualization page, including: uploading an initial Prometheus file, and decompressing the initial Prometheus file to obtain a Prometheus file; configuring the connection port between the node_exporter and the Prometheus file, and saving the running status of the server project and the corresponding running data from the node_exporter to the Prometheus file through the connection port; uploading an initial Granfana file, and The initial Granfana file is decompressed to obtain a Granfana file; a Prometheus panel is created in the Granfana file, and a Prometheus name and a Prometheus address corresponding to the Prometheus file are configured in the Prometheus panel; according to the Prometheus name and the Prometheus address, the running status of the server project in the Prometheus file and the corresponding running data are imported into the Granfana file, and the running status of the server project within a preset time is determined, so as to display the running status of the server project within the preset time through a visualization page.
[0127] Optionally, after using the above-mentioned scheduled task to execute the detection script to detect the running status of the above-mentioned server project, the above-mentioned method also includes: when the running status of the above-mentioned server project is stopped at the current moment, automatically activating the above-mentioned server project; continuously monitoring the running status of the above-mentioned server project, and when the running status of the above-mentioned server project is still the above-mentioned stopped running, continuously activating the above-mentioned server project until the running status of the above-mentioned server project is running or the maximum number of activation times is reached.
[0128] Optionally, the method further includes: when the running status of the server project is stopped at the current moment, issuing a first alarm message, the first alarm message indicating that the running status of the server project is stopped for the first time; when the number of activations of the server project reaches the maximum number of activations and the server project is still in the stopped state, issuing a second alarm message, the second alarm message indicating that the server project cannot be automatically activated.
[0129] Optionally, obtaining a scheduled task execution detection script includes: obtaining a detection period, the detection period being the interval between two adjacent detections of the server project by the scheduled task execution detection script; obtaining projects to be detected, the projects to be detected including at least one of the server projects; and configuring the scheduled task execution detection script according to the detection period and the projects to be detected.
[0130] The devices in this article can be servers, PCs, PADs, mobile phones, etc.
[0131] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program for initializing at least the following method steps:
[0132] Step S201, obtaining a scheduled task execution detection script, wherein the scheduled task execution detection script is used to detect the running status of the server project, and the running status of the server project includes running or stopped running;
[0133] Step S202, using the scheduled task execution detection script to detect the running status of the server project, and according to the running status of the server project, collecting the running data corresponding to the server project in each running status;
[0134] Step S203, determining the operation status of the server project within a preset time according to the operation status of the server project and the corresponding operation data, and displaying the operation status of the server project within the preset time through a visualization page.
[0135] Optionally, the above-mentioned scheduled task execution detection script is used to detect the running status of the above-mentioned server project, including: using the above-mentioned scheduled task execution detection script to detect whether the running port of the above-mentioned server project exists at the current moment; when the running port of the above-mentioned server project exists at the current moment, determining that the running status of the above-mentioned server project is running; when the running port of the above-mentioned server project does not exist at the current moment, determining that the running status of the above-mentioned server project is stopped.
[0136] Optionally, the above-mentioned scheduled task execution detection script is used to detect the running status of the above-mentioned server project, and according to the running status of the above-mentioned server project, the corresponding running data of the above-mentioned server project in each of the above-mentioned running states is collected, including: uploading the initial node_exporter file, and decompressing the above-mentioned initial node_exporter file to obtain the node_exporter file; starting the startup script corresponding to the above-mentioned node_exporter file, and using the collector.textfile function in the above-mentioned node_exporter file to perform customized monitoring of the running status and corresponding running data of the above-mentioned server project, and obtaining the running status of the above-mentioned server project and the corresponding running data.
[0137] Optionally, according to the running status of the server project and the corresponding running data, the running status of the server project within a preset time is determined, and the running status of the server project within the preset time is displayed through a visualization page, including: uploading an initial Prometheus file, and decompressing the initial Prometheus file to obtain a Prometheus file; configuring the connection port between the node_exporter and the Prometheus file, and saving the running status of the server project and the corresponding running data from the node_exporter to the Prometheus file through the connection port; uploading an initial Granfana file, and The initial Granfana file is decompressed to obtain a Granfana file; a Prometheus panel is created in the Granfana file, and a Prometheus name and a Prometheus address corresponding to the Prometheus file are configured in the Prometheus panel; according to the Prometheus name and the Prometheus address, the running status of the server project in the Prometheus file and the corresponding running data are imported into the Granfana file, and the running status of the server project within a preset time is determined, so as to display the running status of the server project within the preset time through a visualization page.
[0138] Optionally, after using the above-mentioned scheduled task to execute the detection script to detect the running status of the above-mentioned server project, the above-mentioned method also includes: when the running status of the above-mentioned server project is stopped at the current moment, automatically activating the above-mentioned server project; continuously monitoring the running status of the above-mentioned server project, and when the running status of the above-mentioned server project is still the above-mentioned stopped running, continuously activating the above-mentioned server project until the running status of the above-mentioned server project is running or the maximum number of activation times is reached.
[0139] Optionally, the method further includes: when the running status of the server project is stopped at the current moment, issuing a first alarm message, the first alarm message indicating that the running status of the server project is stopped for the first time; when the number of activations of the server project reaches the maximum number of activations and the server project is still in the stopped state, issuing a second alarm message, the second alarm message indicating that the server project cannot be automatically activated.
[0140] Optionally, obtaining a scheduled task execution detection script includes: obtaining a detection period, the detection period being the interval between two adjacent detections of the server project by the scheduled task execution detection script; obtaining projects to be detected, the projects to be detected including at least one of the server projects; and configuring the scheduled task execution detection script according to the detection period and the projects to be detected.
[0141] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0142] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0143] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0144] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0145] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0146] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0147] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0148] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0149] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0150] From the above description, it can be seen that the above embodiments of the present application achieve the following technical effects:
[0151] 1) The method for determining the operation status of the above-mentioned server project of the present application first obtains a scheduled task execution detection script, which is used to detect the operation status of the server project, and the operation status of the server project includes being running or stopped; then the scheduled task execution detection script is used to detect the operation status of the server project, and according to the operation status of the server project, the corresponding operation data of the server project in each operation status is collected; finally, according to the operation status of the server project and the corresponding operation data, the operation status of the server project within the preset time is determined, and the operation status of the server project within the preset time is displayed through a visualization page. This method collects corresponding indicators through the monitoring platform, can monitor the operation status of the project in real time, whether the project is automatically running, query the cause of the accidental crash of the project, and ensure the persistent operation of the project, which solves the problem that it is impossible to intuitively confirm whether all server projects are started normally in the prior art, and it takes a lot of time to query whether the project is started.
[0152] 2) The device for determining the operation status of the server project of the present application includes: an acquisition unit, a collection unit, and a determination unit. The acquisition unit is used to acquire a scheduled task execution detection script, and the scheduled task execution detection script is used to detect the operation status of the server project. The operation status of the server project includes running or stopping; the collection unit is used to detect the operation status of the server project using the scheduled task execution detection script, and collect the corresponding operation data of the server project in each operation status according to the operation status of the server project; the determination unit is used to determine the operation status of the server project within a preset time according to the operation status of the server project and the corresponding operation data, and display the operation status of the server project within the preset time through a visualization page. The device collects corresponding indicators through the monitoring platform, can monitor the operation status of the project in real time, whether the project is automatically running, query the cause of the accidental crash of the project, and ensure the persistent operation of the project, which solves the problem that it is impossible to intuitively confirm whether all server projects are started normally in the prior art, and it takes a lot of time to query whether the project is started.
[0153] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for determining the operation status of a server project, characterized in that: include: Obtain a scheduled task execution detection script, where the scheduled task execution detection script is used to detect the running status of the server project, where the running status of the server project includes running or stopped running; Using the scheduled task to execute the detection script to detect the running status of the server project, and according to the running status of the server project, collecting the running data corresponding to the server project in each running status; According to the running status of the server project and the corresponding running data, the running status of the server project within a preset time is determined, and the running status of the server project within the preset time is displayed through a visualization page.
2. The method according to claim 1, characterized in that Using the scheduled task to execute the detection script to detect the running status of the server project includes: Use the scheduled task execution detection script to detect whether the running port of the server project exists at the current moment; If the running port of the server project exists at the current moment, determining that the running state of the server project is running; When the running port of the server project does not exist at the current moment, it is determined that the running state of the server project is stopped.
3. The method according to claim 1, characterized in that Using the scheduled task to execute the detection script to detect the running status of the server project, and collecting the running data corresponding to the server project in each running status according to the running status of the server project, including: Upload the initial node_exporter file and decompress the initial node_exporter file to obtain the node_exporter file; Start the startup script corresponding to the node_exporter file, and use the collector.textfile function in the node_exporter file to perform custom monitoring on the running status and corresponding running data of the server project to obtain the running status and corresponding running data of the server project.
4. The method according to claim 3, characterized in that Determining the operation status of the server project within a preset time according to the operation status of the server project and the corresponding operation data, and displaying the operation status of the server project within the preset time through a visualization page, including: Upload the initial Prometheus file and decompress the initial Prometheus file to obtain the Prometheus file; Configure the connection port of the node_exporter and the Prometheus file, and save the running status of the server project and the corresponding running data from the node_exporter to the Prometheus file through the connection port; Upload the initial Granfana file and decompress the initial Granfana file to obtain the Granfana file; Create a Prometheus panel in the Granfana file, and configure the Prometheus name and Prometheus address corresponding to the Prometheus file in the Prometheus panel; According to the Prometheus name and the Prometheus address, the running status of the server project and the corresponding running data in the Prometheus file are imported into the Granfana file, and the running status of the server project within a preset time is determined, so as to display the running status of the server project within the preset time through a visualization page.
5. The method according to claim 1, characterized in that: After using the scheduled task execution detection script to detect the running status of the server project, the method further includes: When the running state of the server project is stopped at the current moment, automatically activating the server project; The running state of the server project is continuously monitored, and when the running state of the server project is still the stopped running state, the server project is continuously activated until the running state of the server project is running or a maximum activation number is reached.
6. The method according to claim 5, characterized in that The method further comprises: When the running state of the server project is stopped at the current moment, a first alarm message is issued, wherein the first alarm message indicates that the running state of the server project is stopped for the first time; When the number of activations of the server project reaches the maximum number of activations and the server project is still in the stopped state, a second alarm message is issued, wherein the second alarm message indicates that the server project cannot be automatically activated.
7. The method according to claim 1, characterized in that Get the scheduled task execution detection script, including: Obtaining a detection period, where the detection period is the interval between two consecutive detections of the server project by the scheduled task executing the detection script; Acquire a project to be detected, wherein the project to be detected includes at least one of the server projects; According to the detection cycle and the items to be detected, the scheduled task is configured to execute the detection script.
8. A device for determining the operation status of a server project, characterized in that: include: An acquisition unit, used for acquiring a scheduled task execution detection script, wherein the scheduled task execution detection script is used for detecting the running status of a server project, wherein the running status of the server project includes running or stopped running; A collection unit, used to use the scheduled task to execute the detection script to detect the running state of the server project, and collect the running data corresponding to the server project in each running state according to the running state of the server project; The determination unit is used to determine the operation status of the server project within a preset time according to the operation status of the server project and the corresponding operation data, and display the operation status of the server project within the preset time through a visualization page.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method for determining the operation status of a server project according to any one of claims 1 to 7.
10. An electronic device, characterized in that: include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include a method for determining the operation status of a server project as described in any one of claims 1 to 7.
