CN116185774A - Log monitoring installation method, device, computer equipment and storage medium - Google Patents
Log monitoring installation method, device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN116185774A CN116185774A CN202310144461.5A CN202310144461A CN116185774A CN 116185774 A CN116185774 A CN 116185774A CN 202310144461 A CN202310144461 A CN 202310144461A CN 116185774 A CN116185774 A CN 116185774A
- Authority
- CN
- China
- Prior art keywords
- server
- log monitoring
- script
- candidate
- log
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3003—Monitoring arrangements specially adapted to the computing system or computing system component being monitored
- G06F11/302—Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/30—Monitoring
- G06F11/3089—Monitoring arrangements determined by the means or processing involved in sensing the monitored data, e.g. interfaces, connectors, sensors, probes, agents
- G06F11/3093—Configuration details thereof, e.g. installation, enabling, spatial arrangement of the probes
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Quality & Reliability (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
Description
技术领域technical field
本申请涉及计算机技术领域,特别是涉及一种日志监控安装方法、装置、计算机设备和存储介质。The present application relates to the field of computer technology, in particular to a log monitoring installation method, device, computer equipment and storage medium.
背景技术Background technique
近几年来,数据中心服务器规模呈现爆发性增长,其中数量增长最快的主要集中在廉价的X86开放平台系统。与之相伴的是各类linux数据库、中间件等数量同步呈现爆发式的增长。数据库、中间件的日志信息极为重要,许多的报错仅存储在日志中,为此引入日志监控模块,来加强对数据库、中间件日志中错误信息的监控与报警。In recent years, the scale of data center servers has shown explosive growth, and the fastest growing number is mainly concentrated in cheap X86 open platform systems. Accompanied by this is the simultaneous explosive growth in the number of various linux databases and middleware. The log information of the database and middleware is extremely important, and many errors are only stored in the log. For this reason, a log monitoring module is introduced to strengthen the monitoring and alarming of error information in the database and middleware logs.
然而,目前通常利用人工来向服务器安装日志监控。具体的,由人来判断服务器是否需要安装日志监控,并在确定需要向服务器安装日志监控的情况下,手动向服务器安装日志监控。这种方式不仅导致人工成本高,且安装效率低下,亟需改进。However, currently manual installation of log monitoring to servers is usually performed. Specifically, a person judges whether the server needs to install log monitoring, and manually installs log monitoring to the server when it is determined that log monitoring needs to be installed on the server. This method not only leads to high labor costs, but also low installation efficiency, which needs to be improved urgently.
发明内容Contents of the invention
基于此,有必要针对上述技术问题,提供一种日志监控安装方法、装置、计算机设备和存储介质,能够实现日志监控的自动化安装,以降低人工成本,提高安装效率。Based on this, it is necessary to address the above technical problems and provide a log monitoring installation method, device, computer equipment and storage media, which can realize automatic installation of log monitoring, reduce labor costs and improve installation efficiency.
第一方面,本申请提供了一种日志监控安装方法。该方法包括:In a first aspect, the present application provides a log monitoring installation method. The method includes:
在候选服务器内运行日志监控检查脚本;Run the log monitoring check script in the candidate server;
根据运行结果,从候选服务器中选择需要安装日志监控的目标服务器;According to the running results, select the target server that needs to install log monitoring from the candidate servers;
在目标服务器内运行日志监控安装脚本,以将日志监控安装于目标服务器内。Run the Log Monitor installation script on the target server to install Log Monitor on the target server.
在其中一个实施例中,在候选服务器内运行日志监控检查脚本,包括:In one of the embodiments, running the log monitoring and checking script in the candidate server includes:
根据服务器清单,确定候选服务器;Determine the candidate server according to the server list;
向候选服务器下发日志监控检查脚本;Send the log monitoring and checking script to the candidate server;
若检测到当前时间满足预设的巡检周期,则在候选服务器内运行日志监控检查脚本。If it is detected that the current time meets the preset inspection period, the log monitoring and checking script is run in the candidate server.
在其中一个实施例中,根据服务器清单,确定候选服务器,包括:In one of the embodiments, determining candidate servers according to the server list includes:
根据服务器清单中各服务器的巡检次数、运行环境变更情况和日志监控安装情况中的至少一项,从服务器清单的各服务器中选择候选服务器。Select candidate servers from the servers in the server list according to at least one of the number of inspections of each server in the server list, the change of the operating environment, and the installation of log monitoring.
在其中一个实施例中,向候选服务器下发日志监控检查脚本之前,该方法还包括:In one of the embodiments, before sending the log monitoring and checking script to the candidate server, the method further includes:
对日志监控检查脚本的编码格式、输出格式和适配性中的至少一项进行检测。At least one of the encoding format, output format and adaptability of the log monitoring and checking script is detected.
在其中一个实施例中,根据运行结果,从候选服务器中选择需要安装日志监控的目标服务器,包括:In one of the embodiments, according to the operation result, the target server that needs to install log monitoring is selected from the candidate servers, including:
对于每一候选服务器,若根据在该候选服务器内运行日志监控检查脚本的运行结果,识别到该候选服务器内存在数据库和/或中间件,则确定该候选服务器需要安装日志监控,并将该候选服务器作为目标服务器。For each candidate server, if it is identified that there is a database and/or middleware in the candidate server according to the result of running the log monitoring check script in the candidate server, then it is determined that the candidate server needs to install log monitoring, and the candidate server as the target server.
在其中一个实施例中,在目标服务器内运行日志监控安装脚本,以将日志监控安装于目标服务器内,包括:In one of the embodiments, the log monitoring installation script is run in the target server to install the log monitoring in the target server, including:
若检测到当前时间满足预设的安装周期,则向目标服务器下发日志监控安装脚本;If it is detected that the current time meets the preset installation cycle, the log monitoring installation script is sent to the target server;
在目标服务器内运行日志监控安装脚本,以将日志监控安装于目标服务器内。Run the Log Monitor installation script on the target server to install Log Monitor on the target server.
第二方面,本申请还提供了一种日志监控安装装置。该装置包括:In the second aspect, the present application also provides a log monitoring installation device. The unit includes:
脚本运行模块,用于在候选服务器内运行日志监控检查脚本;The script running module is used to run the log monitoring and checking script in the candidate server;
选择模块,用于根据运行结果,从候选服务器中选择需要安装日志监控的目标服务器;The selection module is used to select the target server that needs to install log monitoring from the candidate servers according to the operation result;
安装模块,用于在目标服务器内运行日志监控安装脚本,以将日志监控安装于所述目标服务器内。The installation module is used to run the log monitoring installation script in the target server, so as to install the log monitoring in the target server.
第三方面,本申请还提供了一种计算机设备。所述计算机设备包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现以下步骤:In a third aspect, the present application also provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
在候选服务器内运行日志监控检查脚本;Run the log monitoring check script in the candidate server;
根据运行结果,从候选服务器中选择需要安装日志监控的目标服务器;According to the running results, select the target server that needs to install log monitoring from the candidate servers;
在目标服务器内运行日志监控安装脚本,以将日志监控安装于目标服务器内。Run the Log Monitor installation script on the target server to install Log Monitor on the target server.
第四方面,本申请还提供了一种计算机可读存储介质。所述计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现以下步骤:In a fourth aspect, the present application also provides a computer-readable storage medium. The computer-readable storage medium has a computer program stored thereon, and when the computer program is executed by a processor, the following steps are implemented:
在候选服务器内运行日志监控检查脚本;Run the log monitoring check script in the candidate server;
根据运行结果,从候选服务器中选择需要安装日志监控的目标服务器;According to the running results, select the target server that needs to install log monitoring from the candidate servers;
在目标服务器内运行日志监控安装脚本,以将日志监控安装于目标服务器内。Run the Log Monitor installation script on the target server to install Log Monitor on the target server.
第五方面,本申请还提供了一种计算机程序产品。所述计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现以下步骤:In a fifth aspect, the present application also provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
在候选服务器内运行日志监控检查脚本;Run the log monitoring check script in the candidate server;
根据运行结果,从候选服务器中选择需要安装日志监控的目标服务器;According to the running results, select the target server that needs to install log monitoring from the candidate servers;
在目标服务器内运行日志监控安装脚本,以将日志监控安装于目标服务器内。Run the Log Monitor installation script on the target server to install Log Monitor on the target server.
上述日志监控安装方法、装置、计算机设备和存储介质,通过在候选服务器内运行日志监控检查脚本,并根据运行结果,从候选服务器中选择需要安装日志监控的目标服务器,进而在目标服务器内运行日志监控安装脚本,以实现自动将日志监控安装于目标服务器内。上述方案,相比于相关技术中采用人工来向服务器安装日志监控的方案而言,通过引入日志监控检查脚本和日志监控安装脚本,基于日志监控检查脚本确定出需要安装日志监控的服务器,基于日志监控安装脚本对需要安装日志监控的服务器进行自动化安装,实现了日志监控的自动化安装,降低了人工成本,提高了日志监控安装效率;进一步的,基于日志监控检查脚本和日志监控安装脚本,还可以实现同时向多个服务器安装日志监控,即批量安装日志监控的效果。The above log monitoring installation method, device, computer equipment and storage medium, by running the log monitoring check script in the candidate server, and according to the running results, select the target server that needs to install the log monitoring from the candidate servers, and then run the log in the target server Monitor installation script to automatically install log monitor on the target server. Compared with the scheme of manually installing log monitoring on the server in the related technology, the above scheme introduces the log monitoring inspection script and the log monitoring installation script, and determines the servers that need to be installed with log monitoring based on the log monitoring inspection script. The monitoring installation script automates the installation of servers that need to install log monitoring, realizes the automatic installation of log monitoring, reduces labor costs, and improves the efficiency of log monitoring installation; further, based on the log monitoring inspection script and log monitoring installation script, you can also Realize the installation of log monitoring to multiple servers at the same time, that is, the effect of batch installation of log monitoring.
附图说明Description of drawings
图1为一个实施例中日志监控安装方法的应用环境图;Fig. 1 is the application environment diagram of log monitoring installation method in an embodiment;
图2为一个实施例中日志监控安装方法的流程示意图;Fig. 2 is a schematic flow diagram of a log monitoring installation method in an embodiment;
图3为一个实施例中运行日志监控检查脚本的流程示意图;Fig. 3 is a schematic flow diagram of running a log monitoring and checking script in one embodiment;
图4为另一个实施例中日志监控安装方法的流程示意图;Fig. 4 is a schematic flow chart of a log monitoring installation method in another embodiment;
图5为一个实施例中日志监控安装装置的结构框图;Fig. 5 is a structural block diagram of log monitoring installation device in an embodiment;
图6为另一个实施例中日志监控安装装置的结构框图;Fig. 6 is the structural block diagram of log monitoring installation device in another embodiment;
图7为一个实施例中计算机设备的内部结构图。Figure 7 is an internal block diagram of a computer device in one embodiment.
具体实施方式Detailed ways
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solution and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present application, and are not intended to limit the present application.
本申请实施例提供的日志监控安装方法,可以应用于如何向服务器安装日志监控的情况。本实施例以该方法应用于中心服务器进行举例说明。可以理解的是,该方法也可以应用于终端,或者还可以应用于包括终端和中心服务器的系统,并通过终端和中心服务器的交互实现。例如,在该方法应用于包括终端和中心服务器的系统,并通过终端和中心服务器交互实现的情况下,可以应用于如图1所示的应用环境中。其中,终端102通过网络与中心服务器104进行通信。数据存储系统可以存储中心服务器104需要处理的数据。数据存储系统可以集成在服务器104上,也可以放在云上或其他网络服务器上。可选的,终端102中可以集成一个可视化界面,业务需求方可以在可视化界面中填写候选服务器的信息,例如候选服务器的IP地址等信息;进一步终端102可以向中心服务器104发送检测该候选服务器是否需要安装日志监控的指令,中心服务器104接收到指令之后,即可以向该候选服务器发送运行日志监控检查脚本的指令,该候选服务器接收到中心服务器104发送的指令之后,即可以在该候选服务器的运行平台内运行日志监控检查脚本;若运行结果为该候选服务器需要安装日志监控,进而可以在该候选服务器内运行日志监控安装脚本,以将日志监控安装于该候选服务器内。其中,终端102可以但不限于是各种个人计算机、笔记本电脑、智能手机、平板电脑、物联网设备和便携式可穿戴设备,物联网设备可为智能音箱、智能电视、智能空调、智能车载设备等。便携式可穿戴设备可为智能手表、智能手环、头戴设备等。中心服务器104可以用独立的服务器或者是多个服务器组成的服务器集群来实现。The log monitoring installation method provided in the embodiment of the present application can be applied to how to install log monitoring to a server. This embodiment is described by taking the method applied to the central server as an example. It can be understood that the method can also be applied to a terminal, or can also be applied to a system including a terminal and a central server, and can be implemented through interaction between the terminal and the central server. For example, when the method is applied to a system including a terminal and a central server, and implemented through interaction between the terminal and the central server, it can be applied to the application environment shown in FIG. 1 . Wherein, the terminal 102 communicates with the
在一个实施例中,如图2所示,提供了一种日志监控安装方法,以该方法应用于中心服务器为例进行说明,包括以下步骤:In one embodiment, as shown in FIG. 2 , a log monitoring installation method is provided, and the method is applied to a central server as an example for illustration, including the following steps:
S201,在候选服务器内运行日志监控检查脚本。S201, run a log monitoring and checking script in the candidate server.
在本实施例中,可以将与中心服务器通信的所有服务器均作为候选服务器。日志监控检查脚本即为用于检测候选服务器是否需要安装日志监控的脚本。In this embodiment, all servers communicating with the central server may be used as candidate servers. The log monitoring check script is a script used to detect whether the candidate server needs to install log monitoring.
具体的,业务需求方可以编写日志监控检查脚本和日志监控安装脚本,并将日志监控检查脚本和日志监控安装脚本存储在脚本管理平台中。进一步可以对存储在脚本管理平台的日志监控检查脚本和日志监控安装脚本进行审核,若审核通过,则将日志监控检查脚本和日志监控安装脚本存储在脚本库中;若审核不通过,则继续修改日志监控检查脚本和日志监控安装脚本,再进行审核,直至审核通过,则将审核通过后的日志监控检查脚本和日志监控安装脚本存储在脚本库中。其中,日志监控安装脚本即为用于安装日志监控的脚本。Specifically, the business demand side can write log monitoring inspection scripts and log monitoring installation scripts, and store the log monitoring inspection scripts and log monitoring installation scripts in the script management platform. Further, the log monitoring inspection script and the log monitoring installation script stored in the script management platform can be audited. If the audit is passed, the log monitoring inspection script and the log monitoring installation script will be stored in the script library; if the audit is not passed, continue to modify The log monitoring inspection script and the log monitoring installation script are audited until the audit is passed, and the audited log monitoring inspection script and log monitoring installation script are stored in the script library. Wherein, the log monitoring installation script is a script for installing log monitoring.
进一步的,中心服务器可以先确定候选服务器,而后将存储在脚本库的日志监控检查脚本发送至各个候选服务器,并向各候选服务器发送运行日志监控检查脚本的命令;各候选服务器基于中心服务器发送的运行日志监控检查脚本的命令,在各自的运行平台内运行日志监控检查脚本。其中,中心服务器可以基于预先设定的确定逻辑,来确定候选服务器。例如,中心服务器可以将业务需求方所指定的服务器作为候选服务器。或者,中心服务器可以将部署某一应用或者功能的服务器作为候选服务器等。Further, the central server can first determine the candidate server, then send the log monitoring and checking script stored in the script library to each candidate server, and send an order to run the log monitoring and checking script to each candidate server; The command to run the log monitoring and checking script runs the log monitoring and checking script on the respective running platforms. Wherein, the central server may determine the candidate server based on preset determination logic. For example, the central server may use the server specified by the business demander as the candidate server. Alternatively, the central server may use a server deploying a certain application or function as a candidate server.
S202,根据运行结果,从候选服务器中选择需要安装日志监控的目标服务器。S202. According to the operation result, select the target server that needs to install the log monitoring from the candidate servers.
其中,运行结果即为各候选服务器运行日志监控检查脚本的结果,可以包括需要安装日志监控、不需要安装日志监控检查脚本等。目标服务器即为需要安装日志监控的服务器。可选的,目标服务器的数量可以为一个或多个。Wherein, the running result is the result of each candidate server running the log monitoring and checking script, which may include whether the log monitoring needs to be installed or the log monitoring and checking script does not need to be installed. The target server is the server where log monitoring needs to be installed. Optionally, there may be one or more target servers.
具体的,各候选服务器运行完日志监控检查脚本之后,可以将各候选服务器的运行结果返回给中心服务器,进而中心服务器可以基于每一候选服务器的运行结果,从各候选服务器中选择需要安装日志监控的目标服务器。Specifically, after each candidate server finishes running the log monitoring and checking script, it can return the running results of each candidate server to the central server, and then the central server can select from each candidate server to install log monitoring based on the running results of each candidate server. target server.
一种可实现方式为,可以从各候选服务器中选择出运行结果为需要安装日志监控的候选服务器,进一步可以将运行结果为需要安装日志监控的候选服务器作为目标服务器。One possible way is to select a candidate server whose operation result requires installation of log monitoring from each candidate server, and further take the candidate server whose operation result requires installation of log monitoring as a target server.
另一种可实现方式为,对于每一候选服务器,若根据在该候选服务器内运行日志监控检查脚本的运行结果,识别到该候选服务器内存在数据库和/或中间件,则确定该候选服务器需要安装日志监控,并将该候选服务器作为目标服务器。Another way that can be implemented is, for each candidate server, if it is identified that there is a database and/or middleware in the candidate server according to the running result of running the log monitoring and checking script in the candidate server, then it is determined that the candidate server needs Install log monitoring and use this candidate server as the target server.
可选的,候选服务器内运行日志监控检查脚本的运行结果也可以为存在数据库和/或中间件、不存在数据库和/或中间件。进一步的,若运行结果为存在数据库和/或中间件,则确定需要安装日志监控;若运行结果为不存在数据库和/或中间件,则确定不需要安装日志监控。Optionally, the running result of running the log monitoring and checking script in the candidate server may also be that the database and/or middleware exists, or that the database and/or middleware does not exist. Further, if the running result is that there is a database and/or middleware, it is determined that log monitoring needs to be installed; if the running result is that there is no database and/or middleware, it is determined that there is no need to install log monitoring.
具体的,对于每一候选服务器,根据该候选服务器内运行日志监控检查脚本的运行结果,若识别到该候选服务器的运行结果为存在数据库和/或中间件,则确定该候选服务器需要安装日志监控,进一步将该候选服务器作为目标服务器。Specifically, for each candidate server, according to the running result of the log monitoring and checking script in the candidate server, if it is recognized that the running result of the candidate server is that there is a database and/or middleware, then it is determined that the candidate server needs to install log monitoring , and further set the candidate server as the target server.
S203,在目标服务器内运行日志监控安装脚本,以将日志监控安装于目标服务器内。S203, run the log monitoring installation script in the target server, so as to install the log monitoring in the target server.
一种可实现方式为,在确定出所有需要安装日志监控的目标服务器后,中心服务器可以将存储在脚本库的日志监控安装脚本发送至各个目标服务器,并在向各目标服务器发送运行日志监控安装脚本的命令;各目标服务器基于中心服务器发送的运行日志监控安装脚本的命令,在各自的运行平台内运行日志监控安装脚本,各目标服务器运行结束之后,即可将日志监控安装于各目标服务器内。One way that can be realized is that after determining all the target servers that need to install log monitoring, the central server can send the log monitoring installation script stored in the script library to each target server, and send the running log monitoring installation script to each target server Script commands; each target server runs the log monitoring installation script on its own operating platform based on the commands sent by the central server to run the log monitoring installation script. After the operation of each target server is completed, the log monitoring can be installed in each target server .
或者,中心服务器在向各候选服务器发送日志监控检查脚本时,同时将日志监控安装脚本一起发送至各候选服务器内,各候选服务器会将发送的日志监控安装脚本存储在相关库中,以供后续安装日志监控使用。进一步的,在确定出需要安装日志监控的目标服务器后,中心服务器可以直接在向各目标服务器发送运行日志监控安装脚本的命令,各目标服务器接收到中心服务器发送的运行日志监控安装脚本的命令之后,可以直接从库中调取日志监控安装脚本,进一步在各自的运行平台内运行日志监控安装脚本,各目标服务器运行结束之后,即可将日志监控安装于各目标服务器内。Or, when the central server sends the log monitoring inspection script to each candidate server, it simultaneously sends the log monitoring installation script to each candidate server, and each candidate server will store the sent log monitoring installation script in a relevant library for subsequent use. Install log monitoring usage. Further, after determining the target server that needs to install log monitoring, the central server can directly send the command to run the log monitoring installation script to each target server, after each target server receives the command to run the log monitoring installation script sent by the central server , the log monitoring installation script can be directly retrieved from the library, and the log monitoring installation script can be further run on the respective operating platforms. After the operation of each target server is completed, the log monitoring can be installed in each target server.
另一种可实现方式为,若检测到当前时间满足预设的安装周期,则向目标服务器下发日志监控安装脚本;在目标服务器内运行日志监控安装脚本,以将日志监控安装于目标服务器内。Another possible way is to send the log monitoring installation script to the target server if it is detected that the current time meets the preset installation period; run the log monitoring installation script in the target server to install the log monitoring in the target server .
其中,安装周期即为预先设定的安装日志监控的时间周期;例如,可以设定每周周一安装一次日志监控。可选的,安装周期可以根据服务器的任务处理情况进行确定,以保证日志监控安装不影响服务器的正常业务处理。例如,通过综合考虑,一般情况下,各服务器的业务处理在每天8:00-10:00,则在确定安装日志监控的安装周期时,可以避开这个时间段。Wherein, the installation period is a preset time period for installing log monitoring; for example, log monitoring may be set to be installed once every Monday. Optionally, the installation period can be determined according to the task processing of the server, so as to ensure that the log monitoring installation does not affect the normal business processing of the server. For example, through comprehensive consideration, in general, the business processing of each server is between 8:00-10:00 every day, and this time period can be avoided when determining the installation period of the installation log monitoring.
具体的,若检测到当前时间满足预设的安装周期,则将日志监控安装脚本发送至各目标服务器。例如当前时间为周一下午15:00,则可以确定当前时间满足预设的安装周期;进而向各目标服务器发送日志监控安装脚本。进一步的,各目标服务器可以基于发送的日志监控安装脚本,在自身的运行平台内运行日志监控安装脚本,各目标服务器运行结束之后,即可将日志监控安装于各目标服务器内。可以理解的是,本实施例中引入安装周期,能够使得整个日志监控安装的流程更为规范。Specifically, if it is detected that the current time meets the preset installation period, the log monitoring installation script is sent to each target server. For example, if the current time is 15:00 pm on Monday, it can be determined that the current time satisfies the preset installation period; and then the log monitoring installation script is sent to each target server. Further, each target server can run the log monitoring installation script on its own operating platform based on the sent log monitoring installation script, and after each target server finishes running, the log monitoring can be installed in each target server. It can be understood that the introduction of an installation cycle in this embodiment can make the entire log monitoring installation process more standardized.
为保证各目标服务器中均成功安装日志监控,作为本申请实施例的一种可实施方式,各目标服务器还可以向中心服务器反馈各目标服务器的安装情况,进而中心服务器可以基于各目标服务器的安装情况,确定每一目标服务器的日志监控是否安装完成。例如,在周一下午15:00,各目标服务器运行日志监控安装脚本,若预留的安装时间为30分钟,则在15:30时,中心服务器可以向各目标服务器下发日志监控安装情况的查询指令,各目标服务器接收到中心服务器发送的查询指令之后,进而会向中心服务器反馈各自的安装情况;进一步的,中心服务器可以基于各目标服务器的反馈情况,确定各目标服务器的日志监控是否安装完成。若某一目标服务器的反馈情况为该目标服务器的日志监控未安装完成,则可以向业务需求方下发一个手动安装日志监控的指令,以使业务需求方将该目标服务器的日志监控进行手动安装。In order to ensure that log monitoring is successfully installed in each target server, as a possible implementation of the embodiment of the present application, each target server can also feed back the installation situation of each target server to the central server, and then the central server can be based on the installation of each target server. If necessary, determine whether log monitoring is installed for each target server. For example, at 15:00 on Monday afternoon, each target server runs the log monitoring installation script, if the reserved installation time is 30 minutes, then at 15:30, the central server can send a log monitoring installation status query to each target server Instructions, after each target server receives the query command sent by the central server, it will then feed back its installation status to the central server; further, the central server can determine whether the log monitoring of each target server is installed based on the feedback of each target server . If the feedback from a certain target server is that the log monitoring of the target server has not been installed, you can issue a manual installation log monitoring command to the business demander, so that the business demander can manually install the log monitoring of the target server .
需要说明的是,当目标服务器的数量为多个时,本实施例可以同时在各目标服务器中运行日志监控安装脚本,即可以实现自动批量向服务器安装日志监控的效果。It should be noted that when there are multiple target servers, this embodiment can run the log monitoring installation script on each target server at the same time, that is, the effect of automatically installing log monitoring to the servers in batches can be achieved.
上述日志监控安装方法中,通过在候选服务器内运行日志监控检查脚本,并根据运行结果,从候选服务器中选择需要安装日志监控的目标服务器,进而在目标服务器内运行日志监控安装脚本,以实现自动将日志监控安装于目标服务器内。上述方案,相比于相关技术中采用人工来向服务器安装日志监控的方案而言,通过引入日志监控检查脚本和日志监控安装脚本,基于日志监控检查脚本确定出需要安装日志监控的服务器,基于日志监控安装脚本对需要安装日志监控的服务器进行自动化安装,实现了日志监控的自动化安装,降低了人工成本,提高了日志监控安装效率;进一步的,基于日志监控检查脚本和日志监控安装脚本,还可以实现同时向多个服务器安装日志监控,即批量安装日志监控的效果。In the above log monitoring installation method, by running the log monitoring check script in the candidate server, and according to the running results, select the target server that needs to install log monitoring from the candidate servers, and then run the log monitoring installation script in the target server to realize automatic Install log monitoring on the target server. Compared with the scheme of manually installing log monitoring on the server in the related technology, the above scheme introduces the log monitoring inspection script and the log monitoring installation script, and determines the servers that need to be installed with log monitoring based on the log monitoring inspection script. The monitoring installation script automates the installation of servers that need to install log monitoring, realizes the automatic installation of log monitoring, reduces labor costs, and improves the efficiency of log monitoring installation; further, based on the log monitoring inspection script and log monitoring installation script, you can also Realize the installation of log monitoring to multiple servers at the same time, that is, the effect of batch installation of log monitoring.
在一个实施例中,在上述实施例的基础上,进一步对S201在候选服务器内运行日志监控检查脚本进行详细解释说明。如图3所示,具体包括以下步骤:In one embodiment, on the basis of the above embodiments, S201 is further explained in detail about running the log monitoring and checking script in the candidate server. As shown in Figure 3, it specifically includes the following steps:
S301,根据服务器清单,确定候选服务器。S301. Determine candidate servers according to the server list.
其中,服务器清单即为包含数据中心中所有服务器的清单。可选的,服务器清单中可以记录各服务器的信息,例如服务器的用途、服务器安装日志监控的情况等信息。Wherein, the server list is a list including all servers in the data center. Optionally, the information of each server may be recorded in the server list, such as the purpose of the server, the monitoring status of the server installation log, and the like.
具体的,可以将服务器清单输入至预先训练好的模型中,模型基于服务器清单中记录的各服务器的信息,从各服务器中选择候选服务器,并将选择出的候选服务器进行输出。或者,可以对服务器清单中的所有服务器进行分组,从各组中选择中任意一组作为候选服务器;例如,将服务器清单中的所以服务器平均分为10组,可以将这10组中的任意一组作为候选服务器。Specifically, the server list can be input into the pre-trained model, and the model selects candidate servers from the servers based on the information of each server recorded in the server list, and outputs the selected candidate servers. Alternatively, all the servers in the server list can be grouped, and any group can be selected as a candidate server from each group; for example, all servers in the server list can be divided into 10 groups on average, and any group as a candidate server.
S302,向候选服务器下发日志监控检查脚本。S302, sending a log monitoring and checking script to the candidate server.
具体的,在确定出所有候选服务器后,中心服务器可以在预设时间点将日志监控检查脚本发送至各候选服务器。例如,由于候选服务器较多,若对所有的候选服务器都发送日志监控检查脚本,可能会出现某候选服务器未接收到日志监控检查脚本的情况,则可以对确定出的所有候选服务器进行分组,中心服务器可以依次将日志监控检查脚本发送至各组候选服务器。Specifically, after all candidate servers are determined, the central server may send the log monitoring and checking script to each candidate server at a preset time point. For example, due to the large number of candidate servers, if all candidate servers are sent log monitoring and checking scripts, it may occur that a certain candidate server does not receive the log monitoring and checking script, then all the candidate servers can be grouped, and the center The server may sequentially send the log monitoring and checking script to each group of candidate servers.
S303,若检测到当前时间满足预设的巡检周期,则在候选服务器内运行日志监控检查脚本。S303, if it is detected that the current time satisfies the preset inspection period, run the log monitoring and checking script in the candidate server.
其中,巡检周期即为预先设定的检查服务器是否需要安装日志监控的时间周期;例如,可以设定每周周五巡检一次各服务器是否安装日志监控。可选的,巡检周期也可以根据服务器的任务处理情况进行确定,以保证日志监控安装不影响服务器的正常业务处理。Wherein, the inspection period is a pre-set time period for checking whether the server needs to install log monitoring; for example, it can be set to inspect whether each server needs to install log monitoring every Friday. Optionally, the inspection period may also be determined according to the task processing status of the server, so as to ensure that the log monitoring installation does not affect the normal business processing of the server.
具体的,若检测到当前时间满足预设的巡检周期,例如当前时间为周五中午12:00,则可以确定当前时间满足预设的巡检周期;进而向各候选服务器发送运行日志监控检查脚本的指令。进一步的,各候选服务器可以基于发送的运行日志监控检查脚本的指令,在自身的运行平台内运行日志监控检查脚本,各候选服务器运行结束之后,即可得到各候选服务器运行日志监控检查脚本的运行结果。Specifically, if it is detected that the current time meets the preset inspection cycle, for example, the current time is 12:00 noon on Friday, it can be determined that the current time meets the preset inspection cycle; Script instructions. Further, each candidate server can run the log monitoring and checking script on its own operating platform based on the sent instructions of the running log monitoring and checking script. result.
本实施例中,通过确定出候选服务器,进而在满足巡检周期时,在各候选服务器中运行日志监控检查脚本,以得到需要安装日志监控的目标服务器,为在目标服务器中安装日志监控提供了数据支撑;进一步的,通过引入巡检周期,能够使得整个日志监控自动化安装的流程更为规范。In this embodiment, by determining the candidate servers, and then running the log monitoring and checking script in each candidate server when the inspection period is met, to obtain the target server that needs to install log monitoring, it provides a good solution for installing log monitoring in the target server. Data support; further, by introducing an inspection cycle, the entire log monitoring automation installation process can be more standardized.
在一个实施例中,在上述实施例的基础上,进一步对S201根据服务器清单,确定候选服务器进行详细解释说明。具体过程为,根据服务器清单中各服务器的巡检次数、运行环境变更情况和日志监控安装情况中的至少一项,从服务器清单中各服务器中选择候选服务器。In one embodiment, on the basis of the foregoing embodiments, S201 is further explained in detail for determining candidate servers according to the server list. The specific process is to select a candidate server from each server in the server list according to at least one of the number of inspections of each server in the server list, the change of the operating environment, and the installation of log monitoring.
其中,巡检次数即为检查各服务器是否需要安装日志监控的次数,可以包括0次或1次等。运行环境变更情况可以包括运行环境未变更、运行环境已变更等。日志监控安装情况可以包括已安装日志监控、未安装日志监控等。Wherein, the number of inspection times is the number of times to check whether each server needs to install log monitoring, and may include 0 times or 1 time. The change of the operating environment may include that the operating environment has not changed, the operating environment has changed, and so on. The log monitoring installation status may include that log monitoring has been installed, log monitoring has not been installed, and the like.
具体的,在根据服务器清单中的各服务器的巡检次数这一项来从服务器清单中确定候选服务器的情况下,针对服务器清单中的每一服务器,若该服务器在服务器清单中记录的巡检次数为0次,则将该服务器作为候选服务器。Specifically, in the case of determining the candidate server from the server list according to the number of inspections of each server in the server list, for each server in the server list, if the server is recorded in the server list If the number of times is 0, the server is used as a candidate server.
在根据服务器清单中的各服务器的运行环境变更情况这一项来从服务器清单中确定候选服务器的情况下,针对服务器清单中的每一服务器,若该服务器在服务器清单中记录的运行环境变更情况为运行环境已变更,则将该服务器作为候选服务器。In the case of determining the candidate server from the server list according to the change of the operating environment of each server in the server list, for each server in the server list, if the change of the operating environment of the server recorded in the server list If the operating environment has changed, use this server as a candidate server.
在根据服务器清单中的各服务器的日志监控安装情况这一项来从服务器清单中确定候选服务器的情况下,针对服务器清单中的每一服务器,若该服务器在服务器清单中记录的日志监控安装情况为日志监控未安装,则将该服务器作为候选服务器。In the case of determining the candidate server from the server list according to the log monitoring installation status of each server in the server list, for each server in the server list, if the log monitoring installation status of the server recorded in the server list If log monitoring is not installed, use this server as a candidate server.
需要说明的是,可以根据服务器清单中各服务器的巡检次数、运行环境变更情况和日志监控安装情况这三项中的一项或多项,从服务器清单中各服务器中选择候选服务器。It should be noted that candidate servers can be selected from the servers in the server list according to one or more of the three items of inspection times, operating environment changes, and log monitoring installation in the server list.
本实施例中,通过根据服务器的巡检次数、运行环境变更情况和日志监控安装情况,从服务器清单的各服务器中选择候选服务器,可以快速且精准的确定出候选服务器。In this embodiment, the candidate server can be determined quickly and accurately by selecting the candidate server from the servers in the server list according to the number of inspections of the server, the change of the operating environment and the log monitoring installation condition.
为保证日志监控的精准安装,在一个实施例中,可以对日志监控检查脚本进行检测。可选的,可以在向候选服务器下发日志监控检查脚本之前,比如在中心服务器获取到业务需求方编写的日志监控检测脚本之后,对日志监控检查脚本进行检测。In order to ensure accurate installation of log monitoring, in one embodiment, the log monitoring check script can be detected. Optionally, the log monitoring and checking script can be checked before the log monitoring and checking script is sent to the candidate server, for example, after the central server obtains the log monitoring and checking script written by the business demander.
可选的,对日志监控检查脚本进行检测可以是,对日志监控检查脚本的编码格式、输出格式和适配性中的至少一项进行检测。Optionally, detecting the log monitoring and checking script may be detecting at least one of the encoding format, output format and adaptability of the log monitoring and checking script.
其中,日志监控检查脚本的适配性即为日志监控检查脚本是否与服务器当前的运行环境匹配。可选的,日志监控检查脚本的编码格式和输出格式均为预先设定好的格式。Wherein, the adaptability of the log monitoring and checking script refers to whether the log monitoring and checking script matches the current operating environment of the server. Optionally, the encoding format and output format of the log monitoring and checking script are pre-set formats.
具体的,可以根据专用于检测脚本是否符合业务需求方需求的检测系统,对日志监控检查脚本的编码格式、输出格式和适配性进行检测。例如,可以将日志监控检查脚本输入至检测系统中,针对编码格式或输出格式进行检测,若检测出日志监控检查脚本的编码格式/输出格式不满足预先设定的格式要求,则检测系统的可视化界面会显示结果为,该脚本不符合预先设定的编码格式/输出格式的格式要求;业务需求方可以基于检测系统的可视化界面,点击“下一步”,检测系统即可以直接显示出正确编码格式/输出格式的日志监控检查脚本;Specifically, the encoding format, output format and adaptability of the log monitoring and inspection script can be detected according to the detection system dedicated to detecting whether the script meets the requirements of the business demand side. For example, the log monitoring and inspection script can be input into the detection system to detect the encoding format or output format. If it is detected that the encoding format/output format of the log monitoring and inspection script does not meet the preset format requirements, the visual inspection system The interface will display the result that the script does not meet the format requirements of the preset encoding format/output format; the business demander can click "Next" based on the visual interface of the detection system, and the detection system can directly display the correct encoding format /Output format log monitoring check script;
针对适配性,若检测出日志监控检查脚本的适配性不足,则检测系统的可视化界面会显示结果为,该脚本的适配性不足,且会在最后一行显示出具体的问题;业务需求方可以基于检测系统的可视化界面中显示的具体问题,进一步修改日志监控检查脚本,修改完成后再根据检测系统进一步检测,直至检测通过。For adaptability, if the log monitoring and checking script is detected to be insufficiently adaptable, the visual interface of the detection system will display the result that the script is not sufficiently adaptable, and the specific problem will be displayed in the last line; business requirements The party can further modify the log monitoring and inspection script based on the specific problems displayed in the visual interface of the detection system. After the modification is completed, further detection will be carried out according to the detection system until the detection passes.
进一步的,还可以对日志监控检查脚本的完整性、编码整洁性等进行检测。例如,可以将日志监控检查脚本输入至一个专用检测系统中,该专用检测系统可以在自身的运行平台内运行日志监控检查脚本,以对日志监控检查脚本的完整性、编码整洁性等进行检测。例如,可以检测日志监控检查脚本的功能是否完整(即日志监控检查脚本中是否具有业务需求方要求的所有功能)、日志监控检查脚本中是否存在乱码等。Furthermore, it is also possible to detect the integrity of the log monitoring and inspection script, the neatness of the coding, and the like. For example, the log monitoring and checking script can be input into a special inspection system, and the special checking system can run the log monitoring and checking script in its own running platform to check the completeness and coding tidiness of the log monitoring and checking script. For example, it is possible to detect whether the function of the log monitoring and checking script is complete (that is, whether the log monitoring and checking script has all the functions required by the business demand side), whether there are garbled characters in the log monitoring and checking script, and the like.
本实施例中,通过从编码格式、输出格式和适配性等方面对日志监控检查脚本进行检测,可以使得到的日志监控检查脚本更为精准,以更加精确的确定出需要安装日志监控的服务器。In this embodiment, by detecting the log monitoring and checking script from the aspects of encoding format, output format and adaptability, the obtained log monitoring and checking script can be more accurate, so as to more accurately determine the server that needs to install log monitoring .
同理,还可以对日志监控安装脚本进行检测。可选的,可以在中心服务器获取到业务需求方编写的日志监控安装脚本之后,采用对日志监控检查脚本进行检测的相同方式,对日志监控安装脚本进行检测。例如,可以从日志监控安装脚本的编码格式、输出格式、适配性、完整性、编码整洁性等多方面对日志监控安装脚本进行检测,具体的检测过程同上面所述,不进行具体赘述。Similarly, the log monitoring installation script can also be detected. Optionally, after the central server obtains the log monitoring installation script written by the business demander, it can detect the log monitoring installation script in the same manner as the log monitoring inspection script. For example, the log monitoring installation script can be detected from various aspects such as the encoding format, output format, adaptability, integrity, and coding neatness of the log monitoring installation script. The specific detection process is the same as that described above, and will not be described in detail.
另外,在一个实施例中,本申请还提供一个日志监控安装方法的可选实例。结合图4所示,具体过程包括:In addition, in an embodiment, the present application also provides an optional example of a log monitoring installation method. As shown in Figure 4, the specific process includes:
S401,根据服务器清单中各服务器的巡检次数、运行环境变更情况和日志监控安装情况中的至少一项,从服务器清单的各服务器中选择候选服务器。S401. Select a candidate server from each server in the server list according to at least one of inspection times, operating environment changes, and log monitoring installation conditions of each server in the server list.
S402,对日志监控检查脚本的编码格式、输出格式和适配性中的至少一项进行检测。S402. Detect at least one of the encoding format, output format and adaptability of the log monitoring and checking script.
S403,检测通过后,向候选服务器下发日志监控检查脚本。S403, after passing the detection, deliver the log monitoring and checking script to the candidate server.
S404,若检测到当前时间满足预设的巡检周期,则在候选服务器内运行日志监控检查脚本。S404, if it is detected that the current time satisfies the preset inspection period, run the log monitoring and checking script in the candidate server.
S405,对于每一候选服务器,若根据在该候选服务器内运行日志监控检查脚本的运行结果,识别到该候选服务器内存在数据库和/或中间件,则确定该候选服务器需要安装日志监控,并将该候选服务器作为目标服务器。S405, for each candidate server, if it is identified that there is a database and/or middleware in the candidate server according to the running result of running the log monitoring check script in the candidate server, then it is determined that the candidate server needs to install log monitoring, and The candidate server acts as the target server.
S406,若检测到当前时间满足预设的安装周期,则向目标服务器下发日志监控安装脚本。S406, if it is detected that the current time satisfies the preset installation period, deliver the log monitoring installation script to the target server.
S407,在目标服务器内运行日志监控安装脚本,以将日志监控安装于目标服务器内。S407, run the log monitoring installation script in the target server, so as to install the log monitoring in the target server.
需要说明的是,上述S401-S407给出了一个具体的顺序,但S402对日志监控检查脚本的编码格式、输出格式和适配性中的至少一项进行检测的过程,也可以在S401之前,或者与S401同时执行。进一步的,上述S401-S407的具体过程可以参见上述方法实施例的描述,其实现原理和技术效果类似,在此不再赘述。It should be noted that the above S401-S407 gave a specific sequence, but the process of S402 detecting at least one of the encoding format, output format and adaptability of the log monitoring and checking script can also be performed before S401, Or execute at the same time as S401. Further, for the specific process of the foregoing S401-S407, reference may be made to the description of the foregoing method embodiment, and its implementation principle and technical effect are similar, and details are not repeated here.
应该理解的是,虽然如上所述的各实施例所涉及的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,如上所述的各实施例所涉及的流程图中的至少一部分步骤可以包括多个步骤或者多个阶段,这些步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤中的步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the steps in the flow charts involved in the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least some of the steps in the flow charts involved in the above-mentioned embodiments may include multiple steps or stages, and these steps or stages are not necessarily executed at the same time, but may be performed at different times For execution, the execution order of these steps or stages is not necessarily performed sequentially, but may be executed in turn or alternately with other steps or at least a part of steps or stages in other steps.
基于同样的发明构思,本申请实施例还提供了一种用于实现上述所涉及的日志监控安装方法的日志监控安装装置。该装置所提供的解决问题的实现方案与上述方法中所记载的实现方案相似,故下面所提供的一个或多个日志监控安装装置实施例中的具体限定可以参见上文中对于日志监控安装方法的限定,在此不再赘述。Based on the same inventive concept, an embodiment of the present application further provides a log monitoring installation device for implementing the above-mentioned log monitoring installation method. The solution to the problem provided by the device is similar to the implementation described in the above method, so the specific limitations in one or more log monitoring installation device embodiments provided below can be referred to above for the log monitoring installation method limited and will not be repeated here.
在一个实施例中,如图5所示,提供了一种日志监控安装装置1,包括:脚本运行模块10、选择模块20和安装模块30,其中:In one embodiment, as shown in FIG. 5 , a log
脚本运行模块10,用于在候选服务器内运行日志监控检查脚本;Script running
选择模块20,用于根据运行结果,从候选服务器中选择需要安装日志监控的目标服务器;The
安装模块30,用于在目标服务器内运行日志监控安装脚本,以将日志监控安装于目标服务器内。The
在其中一个实施例中,如图6所示,上述脚本运行模块10包括:In one of the embodiments, as shown in Figure 6, the
确定单元11,用于根据服务器清单,确定候选服务器;A determining
脚本下发单元12,用于向候选服务器下发日志监控检查脚本;
脚本运行单元13,用于若检测到当前时间满足预设的巡检周期,则在候选服务器内运行日志监控检查脚本。The
在其中一个实施例中,上述确定单元11具体用于:In one of the embodiments, the
根据服务器清单中各服务器的巡检次数、运行环境变更情况和日志监控安装情况中的至少一项,从服务器清单的各服务器中选择候选服务器。Select candidate servers from the servers in the server list according to at least one of the number of inspections of each server in the server list, the change of the operating environment, and the installation of log monitoring.
在其中一个实施例中,上述日志监控安装装置1还包括:In one of the embodiments, the above-mentioned log
检测单元,用于对日志监控检查脚本的编码格式、输出格式和适配性中的至少一项进行检测。A detection unit, configured to detect at least one of the encoding format, output format and adaptability of the log monitoring and checking script.
在其中一个实施例中,上述选择模块20具体用于:In one of the embodiments, the
对于每一候选服务器,若根据在该候选服务器内运行日志监控检查脚本的运行结果,识别到该候选服务器内存在数据库和/或中间件,则确定该候选服务器需要安装日志监控,并将该候选服务器作为目标服务器。For each candidate server, if it is identified that there is a database and/or middleware in the candidate server according to the result of running the log monitoring check script in the candidate server, then it is determined that the candidate server needs to install log monitoring, and the candidate server as the target server.
在其中一个实施例中,上述安装模块30具体用于:In one of the embodiments, the above-mentioned
若检测到当前时间满足预设的安装周期,则向目标服务器下发日志监控安装脚本;在目标服务器内运行日志监控安装脚本,以将日志监控安装于目标服务器内。If it is detected that the current time meets the preset installation period, the log monitoring installation script is sent to the target server; the log monitoring installation script is run in the target server to install the log monitoring in the target server.
上述日志监控安装装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。Each module in the above-mentioned log monitoring installation device can be fully or partially realized by software, hardware and combinations thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, and can also be stored in the memory of the computer device in the form of software, so that the processor can invoke and execute the corresponding operations of the above-mentioned modules.
在一个实施例中,提供了一种计算机设备,该计算机设备可以是服务器,其内部结构图可以如图7所示。该计算机设备包括通过系统总线连接的处理器、存储器和网络接口。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质和内存储器。该非易失性存储介质存储有操作系统、计算机程序和数据库。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的数据库用于存储日志监控安装数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种日志监控安装方法。In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure may be as shown in FIG. 7 . The computer device includes a processor, memory and a network interface connected by a system bus. Wherein, the processor of the computer device is used to provide calculation and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs and databases. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database of the computer device is used to store log monitoring installation data. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a log monitoring installation method is realized.
本领域技术人员可以理解,图7中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art can understand that the structure shown in Figure 7 is only a block diagram of a part of the structure related to the solution of this application, and does not constitute a limitation to the computer equipment on which the solution of this application is applied. The specific computer equipment can be More or fewer components than shown in the figures may be included, or some components may be combined, or have a different arrangement of components.
在一个实施例中,提供了一种计算机设备,包括存储器和处理器,存储器中存储有计算机程序,该处理器执行计算机程序时实现以下步骤:In one embodiment, a computer device is provided, including a memory and a processor, a computer program is stored in the memory, and the processor implements the following steps when executing the computer program:
在候选服务器内运行日志监控检查脚本;Run the log monitoring check script in the candidate server;
根据运行结果,从候选服务器中选择需要安装日志监控的目标服务器;According to the running results, select the target server that needs to install log monitoring from the candidate servers;
在目标服务器内运行日志监控安装脚本,以将日志监控安装于目标服务器内。Run the Log Monitor installation script on the target server to install Log Monitor on the target server.
在其中一个实施例中,处理器执行计算机程序中在候选服务器内运行日志监控检查脚本的逻辑时,具体实现以下步骤:In one of the embodiments, when the processor executes the logic of running the log monitoring and checking script in the candidate server in the computer program, the following steps are specifically implemented:
根据服务器清单,确定候选服务器;向候选服务器下发日志监控检查脚本;若检测到当前时间满足预设的巡检周期,则在候选服务器内运行所述日志监控检查脚本。Determine the candidate server according to the server list; send the log monitoring and checking script to the candidate server; if it is detected that the current time meets the preset inspection period, run the log monitoring and checking script in the candidate server.
在其中一个实施例中,处理器执行计算机程序中根据服务器清单,确定候选服务器的逻辑时,具体实现以下步骤:In one of the embodiments, when the processor executes the logic of determining the candidate server according to the server list in the computer program, the following steps are specifically implemented:
根据服务器清单中各服务器的巡检次数、运行环境变更情况和日志监控安装情况中的至少一项,从服务器清单的各服务器中选择候选服务器。Select candidate servers from the servers in the server list according to at least one of the number of inspections of each server in the server list, the change of the operating environment, and the installation of log monitoring.
在其中一个实施例中,处理器执行计算机程序中向所述候选服务器下发日志监控检查脚本之前的逻辑时,具体实现以下步骤:In one of the embodiments, when the processor executes the logic in the computer program before sending the log monitoring and checking script to the candidate server, the following steps are specifically implemented:
对日志监控检查脚本的编码格式、输出格式和适配性中的至少一项进行检测。At least one of the encoding format, output format and adaptability of the log monitoring and checking script is detected.
在其中一个实施例中,处理器执行计算机程序中根据运行结果,从候选服务器中选择需要安装日志监控的目标服务器的逻辑时,具体实现以下步骤:In one of the embodiments, when the processor executes the logic of selecting the target server that needs to install log monitoring from the candidate servers according to the running result in the computer program, the following steps are specifically implemented:
对于每一候选服务器,若根据在该候选服务器内运行日志监控检查脚本的运行结果,识别到该候选服务器内存在数据库和/或中间件,则确定该候选服务器需要安装日志监控,并将该候选服务器作为目标服务器。For each candidate server, if it is identified that there is a database and/or middleware in the candidate server according to the result of running the log monitoring check script in the candidate server, then it is determined that the candidate server needs to install log monitoring, and the candidate server as the target server.
在其中一个实施例中,处理器执行计算机程序中在目标服务器内运行日志监控安装脚本,以将日志监控安装于目标服务器内的逻辑时,具体实现以下步骤:In one of the embodiments, when the processor executes the logic of running the log monitoring installation script in the target server in the computer program to install the log monitoring in the target server, the following steps are specifically implemented:
若检测到当前时间满足预设的安装周期,则向目标服务器下发日志监控安装脚本;在目标服务器内运行日志监控安装脚本,以将日志监控安装于目标服务器内。If it is detected that the current time meets the preset installation period, the log monitoring installation script is sent to the target server; the log monitoring installation script is run in the target server to install the log monitoring in the target server.
上述提供的计算机设备,其在实现各实施例中的原理和具体过程可参见前述实施例中日志监控安装方法实施例中的说明,此处不再赘述。For the computer equipment provided above, the principle and specific process in implementing each embodiment can refer to the description in the embodiment of the log monitoring installation method in the foregoing embodiment, and will not be repeated here.
在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现以下步骤:In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
在候选服务器内运行日志监控检查脚本;Run the log monitoring check script in the candidate server;
根据运行结果,从候选服务器中选择需要安装日志监控的目标服务器;According to the running results, select the target server that needs to install log monitoring from the candidate servers;
在目标服务器内运行日志监控安装脚本,以将日志监控安装于目标服务器内。Run the Log Monitor installation script on the target server to install Log Monitor on the target server.
在其中一个实施例中,计算机程序中在候选服务器内运行日志监控检查脚本的逻辑被处理器执行时,具体实现以下步骤:In one of the embodiments, when the logic of running the log monitoring and checking script in the candidate server in the computer program is executed by the processor, the following steps are specifically implemented:
根据服务器清单,确定候选服务器;向候选服务器下发日志监控检查脚本;若检测到当前时间满足预设的巡检周期,则在候选服务器内运行日志监控检查脚本。Determine the candidate server according to the server list; send the log monitoring and checking script to the candidate server; if it is detected that the current time meets the preset inspection cycle, run the log monitoring and checking script in the candidate server.
在其中一个实施例中,计算机程序中根据服务器清单,确定候选服务器的逻辑被处理器执行时,具体实现以下步骤:In one of the embodiments, when the logic of determining candidate servers in the computer program is executed by the processor according to the list of servers, the following steps are specifically implemented:
根据服务器清单中各服务器的巡检次数、运行环境变更情况和日志监控安装情况中的至少一项,从服务器清单的各服务器中选择候选服务器。Select candidate servers from the servers in the server list according to at least one of the number of inspections of each server in the server list, the change of the operating environment, and the installation of log monitoring.
在其中一个实施例中,计算机程序中向候选服务器下发日志监控检查脚本之前的逻辑被处理器执行时,具体实现以下步骤:In one of the embodiments, when the logic in the computer program before sending the log monitoring and checking script to the candidate server is executed by the processor, the following steps are specifically implemented:
对日志监控检查脚本的编码格式、输出格式和适配性中的至少一项进行检测。At least one of the encoding format, output format and adaptability of the log monitoring and checking script is detected.
在其中一个实施例中,计算机程序中根据运行结果,从候选服务器中选择需要安装日志监控的目标服务器的逻辑被处理器执行时,具体实现以下步骤:In one of the embodiments, when the logic of selecting the target server that needs to install log monitoring from the candidate servers according to the running result in the computer program is executed by the processor, the following steps are specifically implemented:
对于每一候选服务器,若根据在该候选服务器内运行日志监控检查脚本的运行结果,识别到该候选服务器内存在数据库和/或中间件,则确定该候选服务器需要安装日志监控,并将该候选服务器作为目标服务器。For each candidate server, if it is identified that there is a database and/or middleware in the candidate server according to the result of running the log monitoring check script in the candidate server, then it is determined that the candidate server needs to install log monitoring, and the candidate server as the target server.
在其中一个实施例中,计算机程序中在目标服务器内运行日志监控安装脚本,以将日志监控安装于目标服务器内的逻辑被处理器执行时,具体实现以下步骤:In one of the embodiments, the computer program runs the log monitoring installation script in the target server, so that when the logic for installing the log monitoring in the target server is executed by the processor, the following steps are specifically implemented:
若检测到当前时间满足预设的安装周期,则向目标服务器下发日志监控安装脚本;在目标服务器内运行日志监控安装脚本,以将日志监控安装于目标服务器内。If it is detected that the current time meets the preset installation period, the log monitoring installation script is sent to the target server; the log monitoring installation script is run in the target server to install the log monitoring in the target server.
上述提供的计算机可读存储介质,其在实现各实施例中的原理和具体过程可参见前述实施例中日志监控安装方法实施例中的说明,此处不再赘述。For the computer-readable storage medium provided above, the principle and specific process in implementing each embodiment can refer to the description in the embodiment of the log monitoring installation method in the foregoing embodiment, and will not be repeated here.
在一个实施例中,提供了一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现以下步骤:In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
在候选服务器内运行日志监控检查脚本;Run the log monitoring check script in the candidate server;
根据运行结果,从候选服务器中选择需要安装日志监控的目标服务器;According to the running results, select the target server that needs to install log monitoring from the candidate servers;
在目标服务器内运行日志监控安装脚本,以将日志监控安装于目标服务器内。Run the Log Monitor installation script on the target server to install Log Monitor on the target server.
在其中一个实施例中,计算机程序中在候选服务器内运行日志监控检查脚本的逻辑被处理器执行时,具体实现以下步骤:In one of the embodiments, when the logic of running the log monitoring and checking script in the candidate server in the computer program is executed by the processor, the following steps are specifically implemented:
根据服务器清单,确定候选服务器;向候选服务器下发日志监控检查脚本;若检测到当前时间满足预设的巡检周期,则在候选服务器内运行日志监控检查脚本。Determine the candidate server according to the server list; send the log monitoring and checking script to the candidate server; if it is detected that the current time meets the preset inspection cycle, run the log monitoring and checking script in the candidate server.
在其中一个实施例中,计算机程序中根据服务器清单,确定候选服务器的逻辑被处理器执行时,具体实现以下步骤:In one of the embodiments, when the logic of determining candidate servers in the computer program is executed by the processor according to the list of servers, the following steps are specifically implemented:
根据服务器清单中各服务器的巡检次数、运行环境变更情况和日志监控安装情况中的至少一项,从服务器清单的各服务器中选择候选服务器。Select candidate servers from the servers in the server list according to at least one of the number of inspections of each server in the server list, the change of the operating environment, and the installation of log monitoring.
在其中一个实施例中,计算机程序中向候选服务器下发日志监控检查脚本之前的逻辑被处理器执行时,具体实现以下步骤:In one of the embodiments, when the logic in the computer program before sending the log monitoring and checking script to the candidate server is executed by the processor, the following steps are specifically implemented:
对日志监控检查脚本的编码格式、输出格式和适配性中的至少一项进行检测。At least one of the encoding format, output format and adaptability of the log monitoring and checking script is detected.
在其中一个实施例中,计算机程序中根据运行结果,从候选服务器中选择需要安装日志监控的目标服务器的逻辑被处理器执行时,具体实现以下步骤:In one of the embodiments, when the logic of selecting the target server that needs to install log monitoring from the candidate servers according to the running result in the computer program is executed by the processor, the following steps are specifically implemented:
对于每一候选服务器,若根据在该候选服务器内运行日志监控检查脚本的运行结果,识别到该候选服务器内存在数据库和/或中间件,则确定该候选服务器需要安装日志监控,并将该候选服务器作为目标服务器。For each candidate server, if it is identified that there is a database and/or middleware in the candidate server according to the result of running the log monitoring check script in the candidate server, then it is determined that the candidate server needs to install log monitoring, and the candidate server as the target server.
在其中一个实施例中,计算机程序中在目标服务器内运行日志监控安装脚本,以将日志监控安装于目标服务器内的逻辑被处理器执行时,具体实现以下步骤:In one of the embodiments, the computer program runs the log monitoring installation script in the target server, so that when the logic for installing the log monitoring in the target server is executed by the processor, the following steps are specifically implemented:
若检测到当前时间满足预设的安装周期,则向目标服务器下发日志监控安装脚本;在目标服务器内运行日志监控安装脚本,以将日志监控安装于目标服务器内。If it is detected that the current time meets the preset installation period, the log monitoring installation script is sent to the target server; the log monitoring installation script is run in the target server to install the log monitoring in the target server.
上述提供的计算机程序产品,其在实现各实施例中的原理和具体过程可参见前述实施例中日志监控安装方法实施例中的说明,此处不再赘述。For the computer program product provided above, the principle and specific process in implementing each embodiment can refer to the description in the embodiment of the log monitoring installation method in the foregoing embodiment, and will not be repeated here.
需要说明的是,本申请所涉及数据(包括但不限于日志监控检查脚本、日志监控安装脚本、服务器的相关数据等),均为经用户授权或者经过各方充分授权的信息和数据。It should be noted that the data involved in this application (including but not limited to log monitoring and checking scripts, log monitoring installation scripts, server-related data, etc.) are all information and data authorized by the user or fully authorized by all parties.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、数据库或其它介质的任何引用,均可包括非易失性和易失性存储器中的至少一种。非易失性存储器可包括只读存储器(Read-OnlyMemory,ROM)、磁带、软盘、闪存、光存储器、高密度嵌入式非易失性存储器、阻变存储器(ReRAM)、磁变存储器(Magnetoresistive Random Access Memory,MRAM)、铁电存储器(Ferroelectric Random Access Memory,FRAM)、相变存储器(Phase Change Memory,PCM)、石墨烯存储器等。易失性存储器可包括随机存取存储器(Random Access Memory,RAM)或外部高速缓冲存储器等。作为说明而非局限,RAM可以是多种形式,比如静态随机存取存储器(Static Random Access Memory,SRAM)或动态随机存取存储器(Dynamic RandomAccess Memory,DRAM)等。本申请所提供的各实施例中所涉及的数据库可包括关系型数据库和非关系型数据库中至少一种。非关系型数据库可包括基于区块链的分布式数据库等,不限于此。本申请所提供的各实施例中所涉及的处理器可为通用处理器、中央处理器、图形处理器、数字信号处理器、可编程逻辑器、基于量子计算的数据处理逻辑器等,不限于此。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above-mentioned embodiments can be completed by instructing related hardware through computer programs, and the computer programs can be stored in a non-volatile computer-readable memory In the medium, when the computer program is executed, it may include the processes of the embodiments of the above-mentioned methods. Wherein, any reference to storage, database or other media used in the various embodiments provided in the present application may include at least one of non-volatile and volatile storage. Non-volatile memory can include read-only memory (Read-Only Memory, ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive variable memory (ReRAM), magnetic variable memory (Magnetoresistive Random Access Memory, MRAM), Ferroelectric Random Access Memory (FRAM), Phase Change Memory (Phase Change Memory, PCM), graphene memory, etc. The volatile memory may include random access memory (Random Access Memory, RAM) or external cache memory. As an illustration and not a limitation, RAM can be in various forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (Dynamic Random Access Memory, DRAM). The databases involved in the various embodiments provided in this application may include at least one of a relational database and a non-relational database. The non-relational database may include a blockchain-based distributed database, etc., but is not limited thereto. The processors involved in the various embodiments provided by this application can be general-purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, data processing logic devices based on quantum computing, etc., and are not limited to this.
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments can be combined arbitrarily. To make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be It is considered to be within the range described in this specification.
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请的保护范围应以所附权利要求为准。The above-mentioned embodiments only express several implementation modes of the present application, and the description thereof is relatively specific and detailed, but should not be construed as limiting the patent scope of the present application. It should be noted that those skilled in the art can make several modifications and improvements without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be determined by the appended claims.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310144461.5A CN116185774A (en) | 2023-02-07 | 2023-02-07 | Log monitoring installation method, device, computer equipment and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310144461.5A CN116185774A (en) | 2023-02-07 | 2023-02-07 | Log monitoring installation method, device, computer equipment and storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN116185774A true CN116185774A (en) | 2023-05-30 |
Family
ID=86434172
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202310144461.5A Pending CN116185774A (en) | 2023-02-07 | 2023-02-07 | Log monitoring installation method, device, computer equipment and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN116185774A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN117076185A (en) * | 2023-10-16 | 2023-11-17 | 太平金融科技服务(上海)有限公司 | Server inspection method, device, equipment and medium |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2019237532A1 (en) * | 2018-06-14 | 2019-12-19 | 平安科技(深圳)有限公司 | Service data monitoring method, storage medium, terminal device and apparatus |
| CN110912757A (en) * | 2019-12-24 | 2020-03-24 | 聚好看科技股份有限公司 | Service monitoring method and server |
| CN111475369A (en) * | 2020-03-05 | 2020-07-31 | 中国平安人寿保险股份有限公司 | Method, device, computer equipment and storage medium for adding log monitoring |
| CN113485892A (en) * | 2021-06-30 | 2021-10-08 | 中国民航信息网络股份有限公司 | Data analysis method, system, electronic equipment and storage medium |
-
2023
- 2023-02-07 CN CN202310144461.5A patent/CN116185774A/en active Pending
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2019237532A1 (en) * | 2018-06-14 | 2019-12-19 | 平安科技(深圳)有限公司 | Service data monitoring method, storage medium, terminal device and apparatus |
| CN110912757A (en) * | 2019-12-24 | 2020-03-24 | 聚好看科技股份有限公司 | Service monitoring method and server |
| CN111475369A (en) * | 2020-03-05 | 2020-07-31 | 中国平安人寿保险股份有限公司 | Method, device, computer equipment and storage medium for adding log monitoring |
| CN113485892A (en) * | 2021-06-30 | 2021-10-08 | 中国民航信息网络股份有限公司 | Data analysis method, system, electronic equipment and storage medium |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN117076185A (en) * | 2023-10-16 | 2023-11-17 | 太平金融科技服务(上海)有限公司 | Server inspection method, device, equipment and medium |
| CN117076185B (en) * | 2023-10-16 | 2024-01-05 | 太平金融科技服务(上海)有限公司 | Server inspection method, device, equipment and medium |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11176113B2 (en) | Indexing and relaying data to hot storage | |
| US9274782B2 (en) | Automated computer application update analysis | |
| CN109634587B (en) | Method and equipment for generating warehousing script and warehousing data | |
| CN111309734B (en) | Method and system for automatically generating table data | |
| US20140330744A1 (en) | Analytic solution integration | |
| CN108664289B (en) | Service data processing method and terminal equipment | |
| CN114490664A (en) | Data verification method and device, computer equipment and storage medium | |
| CN116185774A (en) | Log monitoring installation method, device, computer equipment and storage medium | |
| CN111522832A (en) | Big data real-time updating method, system, equipment and storage medium | |
| CN115599401A (en) | Publishing method, device, equipment and medium of user-defined model | |
| CN111694684A (en) | Abnormal construction method and device of storage equipment, electronic equipment and storage medium | |
| CN114036171A (en) | Application data management method and device, computer equipment and storage medium | |
| CN117851484A (en) | Data processing method and device based on rule engine and computer equipment | |
| CN117591260A (en) | Task execution method, device, equipment, storage medium and program product | |
| CN116938681A (en) | Twin data auditing method and device of network element equipment and computer equipment | |
| CN117492767A (en) | Project processing method, device, computer equipment and storage medium | |
| US11474794B2 (en) | Generating mock services based on log entries | |
| CN111633642B (en) | Robot management method and device, electronic equipment and storage medium | |
| CN115408180A (en) | Data processing method, device and medium | |
| US9514241B1 (en) | Consistently delivering a web page having source code with a dynamic instruction | |
| CN115270766A (en) | A data quality verification method for long text extraction results | |
| CN117519613B (en) | A storage volume sharing method and system across k8s clusters | |
| CN114138648B (en) | A server reliability testing method, device, server and storage medium | |
| CN116339777A (en) | System patch processing method, device, computer equipment and storage medium | |
| CN117785674A (en) | Interface use case generation method, device, computer equipment and storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination |