WO2021120975A1 - Monitoring method and apparatus - Google Patents

Monitoring method and apparatus Download PDF

Info

Publication number
WO2021120975A1
WO2021120975A1 PCT/CN2020/130169 CN2020130169W WO2021120975A1 WO 2021120975 A1 WO2021120975 A1 WO 2021120975A1 CN 2020130169 W CN2020130169 W CN 2020130169W WO 2021120975 A1 WO2021120975 A1 WO 2021120975A1
Authority
WO
WIPO (PCT)
Prior art keywords
monitoring
host
monitored
plug
historical
Prior art date
Application number
PCT/CN2020/130169
Other languages
French (fr)
Chinese (zh)
Inventor
陈扬东
饶俊明
卢道和
郑晓腾
赵文相
吴传民
夏敏捷
吴立
龚治文
Original Assignee
深圳前海微众银行股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳前海微众银行股份有限公司 filed Critical 深圳前海微众银行股份有限公司
Publication of WO2021120975A1 publication Critical patent/WO2021120975A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3089Monitoring arrangements determined by the means or processing involved in sensing the monitored data, e.g. interfaces, connectors, sensors, probes, agents
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs

Abstract

A monitoring method and apparatus. The method comprises: receiving a monitoring request, the monitoring request carrying an identifier of a host to be monitored (201); acquiring resource configuration information of said host according to the identifier of said host (202); determining a monitoring plug-in that matches the resource configuration information of said host (203); and monitoring said host by using the monitoring plug-in, and obtaining a monitoring value of said host at a current moment (204). Monitoring plug-ins corresponding to various resource configuration information are configured so that the described method can be applied to monitoring scenarios having different resource configuration information and is not limited to a fixed monitoring scenario, which may thereby improve the flexibility of host monitoring. In addition, monitoring a host to be monitored by using a monitoring plug-in that matches resource configuration information of said host can further enable the monitoring of said host to be more targeted, thereby improving the accuracy of host monitoring.

Description

一种监控方法及装置Monitoring method and device
相关申请的交叉引用Cross-references to related applications
本申请要求在2019年12月20日提交中国专利局、申请号为201911331007.0、申请名称为“一种监控方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office, the application number is 201911331007.0, and the application name is "a monitoring method and device" on December 20, 2019, the entire content of which is incorporated into this application by reference.
技术领域Technical field
本发明涉及金融科技(Fintech)技术领域,尤其涉及一种监控方法及装置。The present invention relates to the technical field of financial technology (Fintech), in particular to a monitoring method and device.
背景技术Background technique
随着计算机技术的发展,越来越多的技术应用在金融领域,传统金融业正在逐步向金融科技(Fintech)转变,然而,由于金融行业的安全性、实时性要求,金融行业也对技术提出了更高的要求。With the development of computer technology, more and more technologies are applied in the financial field. The traditional financial industry is gradually changing to Fintech. However, due to the security and real-time requirements of the financial industry, the financial industry also proposes technology. Higher requirements.
Zabbix是一种常用的开源监控框架,Zabbix中设置有固定的监控策略,当用户需要对主机进行监控时,可以直接调用Zabbix中固定的监控策略监控主机的固定模块,比如监控主机的磁盘使用量和内存占用量。然而,固定的监控策略只能对固定的主机资源进行监控,从而适用的应用场景较为单一,无法适应不同应用场景的需求,从而导致主机监控的灵活性较差。Zabbix is a commonly used open source monitoring framework. Zabbix has a fixed monitoring strategy. When users need to monitor the host, they can directly call the fixed monitoring strategy in Zabbix to monitor the fixed module of the host, such as monitoring the disk usage of the host. And memory footprint. However, a fixed monitoring strategy can only monitor fixed host resources, so the applicable application scenarios are relatively single and cannot adapt to the needs of different application scenarios, resulting in poor flexibility of host monitoring.
综上,目前亟需一种监控方法,用以解决现有技术使用固定的监控策略监控主机所导致的主机监控的灵活性较差的技术问题。In summary, there is an urgent need for a monitoring method to solve the technical problem of poor flexibility of host monitoring caused by the prior art using a fixed monitoring strategy to monitor the host.
发明内容Summary of the invention
本发明实施例提供一种监控方法及装置,用以解决现有技术使用固定的监控策略监控主机所导致的主机监控的灵活性较差的技术问题。The embodiment of the present invention provides a monitoring method and device to solve the technical problem of poor flexibility of host monitoring caused by the use of a fixed monitoring strategy to monitor the host in the prior art.
第一方面,本发明实施例提供的一种监控方法,包括:In the first aspect, a monitoring method provided by an embodiment of the present invention includes:
接收监控请求,所述监控请求中携带有待监控主机的标识,根据所述待监控主机的标识,获取所述待监控主机的资源配置信息,并确定与所述待监控主机的资源配置信息匹配的监控插件,使用所述监控插件监控所述待监控主机,得到所述待监控主机在当前时刻的监控值。Receive a monitoring request, where the monitoring request carries the identifier of the host to be monitored, obtain the resource configuration information of the host to be monitored according to the identifier of the host to be monitored, and determine the one that matches the resource configuration information of the host to be monitored Monitoring plug-in, using the monitoring plug-in to monitor the host to be monitored, and obtain the monitoring value of the host to be monitored at the current moment.
本发明实施例中,通过设置各种资源配置信息对应的监控插件,使得该方案能够适用于具有不同资源配置信息的监控场合,而不用限定在固定的监控场合,从而可以提高主机监控的灵活性;且,通过使用待监控主机的资源配置信息匹配的监控插件监控待监控主机,还可以使得对待监控主机的监控更有针对性,从而提高主机监控的准确性。In the embodiment of the present invention, by setting monitoring plug-ins corresponding to various resource configuration information, the solution can be applied to monitoring occasions with different resource configuration information, instead of being limited to fixed monitoring occasions, thereby improving the flexibility of host monitoring. ; Moreover, monitoring the host to be monitored by using a monitoring plug-in matching the resource configuration information of the host to be monitored can also make the monitoring of the host to be monitored more targeted, thereby improving the accuracy of host monitoring.
第二方面,本发明实施例提供的一种监控装置,所述装置包括:In a second aspect, an embodiment of the present invention provides a monitoring device, the device including:
收发模块,用于接收监控请求,所述监控请求中携带有待监控主机的标识;The transceiver module is configured to receive a monitoring request, and the monitoring request carries an identifier of the host to be monitored;
获取模块,用于根据所述待监控主机的标识,获取所述待监控主机的资源配置信息;An obtaining module, configured to obtain resource configuration information of the host to be monitored according to the identifier of the host to be monitored;
确定模块,用于确定与所述待监控主机的资源配置信息匹配的监控插件;The determining module is used to determine the monitoring plug-in matching the resource configuration information of the host to be monitored;
监控模块,用于使用所述监控插件监控所述待监控主机,得到所述待监控主机在当前时刻的监控值。The monitoring module is used to monitor the host to be monitored by using the monitoring plug-in to obtain the monitoring value of the host to be monitored at the current moment.
第三方面,本发明实施例提供的一种计算设备,包括至少一个处理器以及至少一个存储器,其中,所述存储器存储有计算机程序,当所述程序被所述处理器执行时,使得所述处理器执行上述第一方面任意所述的监控方法。In a third aspect, a computing device provided by an embodiment of the present invention includes at least one processor and at least one memory, wherein the memory stores a computer program, and when the program is executed by the processor, the The processor executes the monitoring method described in any of the foregoing first aspect.
第四方面,本发明实施例提供的一种计算机可读存储介质,其存储有可由计算设备执行的计算机程序,当所述程序在所述计算设备上运行时,使得所述计算设备执行上述第一方面任意所述的监控方法。In a fourth aspect, a computer-readable storage medium provided by an embodiment of the present invention stores a computer program that can be executed by a computing device. When the program runs on the computing device, the computing device executes the above-mentioned first On the one hand, any of the aforementioned monitoring methods.
第五方面,本发明实施例提供的一种计算机程序产品,所述计算机程序产品包括存储在计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行上述第一方面任意所述的监控方法的步骤。In a fifth aspect, a computer program product provided by an embodiment of the present invention includes a computer program stored on a computer-readable storage medium, the computer program includes program instructions, and when the program instructions are executed by a computer At this time, the computer is caused to execute the steps of any of the monitoring methods described in the first aspect.
附图说明Description of the drawings
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简要介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to explain the technical solutions in the embodiments of the present invention more clearly, the following will briefly introduce the drawings needed in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained from these drawings without creative labor.
图1为本发明实施例提供的一种可选的系统架构示意图;FIG. 1 is a schematic diagram of an optional system architecture provided by an embodiment of the present invention;
图2为本发明实施例提供的一种监控方法对应的流程示意图;FIG. 2 is a schematic flowchart corresponding to a monitoring method provided by an embodiment of the present invention;
图3为本发明实施例提供的一种监控系统的架构示意图;3 is a schematic diagram of the architecture of a monitoring system provided by an embodiment of the present invention;
图4为本发明实施例提供的一种监控装置的结构示意图;4 is a schematic structural diagram of a monitoring device provided by an embodiment of the present invention;
图5为本发明实施例提供的一种计算设备的结构示意图。Fig. 5 is a schematic structural diagram of a computing device provided by an embodiment of the present invention.
具体实施方式Detailed ways
为了使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明作进一步地详细描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。In order to make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of them. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of the present invention.
图1为本发明实施例提供的一种可能的系统架构示意图,如图1所示,该系统架构中可以包括监控系统110、客户端120和至少一个主机,比如主机131、主机132和主机133。其中,监控系统110可以分别与客户端120和每个待监控主机连接,比如可以通过有线方式连接,也可以通过无线方式连接,具体不作限定。FIG. 1 is a schematic diagram of a possible system architecture provided by an embodiment of the present invention. As shown in FIG. 1, the system architecture may include a monitoring system 110, a client 120, and at least one host, such as a host 131, a host 132, and a host 133. . Wherein, the monitoring system 110 may be respectively connected with the client 120 and each host to be monitored, for example, it may be connected in a wired manner, or may be connected in a wireless manner, which is not specifically limited.
需要说明的是,图1仅是一种示例性的简单说明,其所列举的各个主机仅是为了便于说明方案,并不构成对方案的限定,在具体实施中,各个主机也可以按照部署情况划分为多个主机群,以便于监控系统110直接对待监控主机群中的多个主机进行监控,不作限定。It should be noted that Figure 1 is only an exemplary simple description. The hosts listed are only for the convenience of illustrating the solution, and do not constitute a limitation on the solution. In specific implementation, each host can also be deployed according to the deployment situation. It is divided into multiple host groups, so that the monitoring system 110 directly monitors multiple hosts in the host group to be monitored, which is not limited.
基于图1所示意的系统架构,图2为本发明实施例提供的一种监控方法对应的流程示意图,该方法适用于监控系统110,如图2所示,该方法包括:Based on the system architecture shown in FIG. 1, FIG. 2 is a schematic flowchart of a monitoring method provided by an embodiment of the present invention. The method is applicable to the monitoring system 110. As shown in FIG. 2, the method includes:
步骤201,接收监控请求,所述监控请求中携带有待监控主机的标识。Step 201: Receive a monitoring request, where the monitoring request carries an identifier of the host to be monitored.
此处,监控请求可以由客户端120发送给监控系统110。Here, the monitoring request may be sent by the client 120 to the monitoring system 110.
在一种可能的实现方式中,客户端120可以为具有界面显示功能的任意终端设备,比 如手机、笔记本电脑、Ipad等。客户端120上部署有web浏览器,监控系统110中部署有全球广域网(World Wide Web,web)服务器,监控系统110可以通过客户端120上部署的web浏览器向用户显示监控界面,而客户端120可以根据用户在监控界面上的操作生成监控请求,并发送给监控系统110。In a possible implementation manner, the client 120 may be any terminal device with an interface display function, such as a mobile phone, a notebook computer, an Ipad, and so on. A web browser is deployed on the client 120, and a World Wide Web (web) server is deployed in the monitoring system 110. The monitoring system 110 can display the monitoring interface to the user through the web browser deployed on the client 120, and the client 120 may generate a monitoring request according to the user's operation on the monitoring interface, and send it to the monitoring system 110.
具体实施中,监控系统110可以通过如下步骤接收到监控请求:In specific implementation, the monitoring system 110 may receive the monitoring request through the following steps:
步骤a,客户端120向监控系统110发送登录界面访问请求,登录界面访问请求中携带有登录界面的统一资源定位符(Uniform Resource Locator,URL)地址。Step a: The client 120 sends a login interface access request to the monitoring system 110, and the login interface access request carries a uniform resource locator (URL) address of the login interface.
具体实施中,当用户存在对主机的监控需求时,用户可以在客户端120的web浏览器上输入预设链接,预设链接中包括登录界面的URL地址,登录界面的URL地址至少由监控系统110的IP地址、端口号和登录界面的标识构成。如此,当客户端120监控到用户在web浏览器上的输入操作后,可以基于输入的登录界面的URL地址生成登录界面访问请求,并发送给监控系统110。In specific implementation, when the user has a monitoring requirement for the host, the user can enter a preset link on the web browser of the client 120. The preset link includes the URL address of the login interface. The URL address of the login interface is at least determined by the monitoring system. 110's IP address, port number, and login interface logo. In this way, after the client 120 monitors the user's input operation on the web browser, it can generate a login interface access request based on the entered URL address of the login interface, and send it to the monitoring system 110.
步骤b,监控系统110解析登录界面访问请求得到登录界面的标识,根据登录界面的标识将登录界面发送给客户端120。Step b: The monitoring system 110 parses the login interface access request to obtain the identification of the login interface, and sends the login interface to the client 120 according to the identification of the login interface.
步骤c,客户端120通过web浏览器显示登录界面。Step c: The client 120 displays a login interface through a web browser.
步骤d,客户端120获取用户在登录界面中输入的身份信息,并生成监控界面访问请求,监控界面访问请求中携带有用户的身份信息。In step d, the client 120 obtains the identity information entered by the user in the login interface, and generates a monitoring interface access request. The monitoring interface access request carries the user's identity information.
步骤e,监控系统110解析监控界面访问请求得到用户的身份信息后,对用户的身份信息进行鉴权,并根据鉴权结果确定用户对应的监控界面。Step e: After the monitoring system 110 parses the monitoring interface access request to obtain the user's identity information, it authenticates the user's identity information, and determines the user's corresponding monitoring interface according to the authentication result.
在一个示例中,监控系统110中存储有身份信息与监控权限的对应关系,该对应关系包括预先在监控系统注册的各个身份信息和各个身份信息对应的监控权限,每个身份信息对应的监控权限可以为普通用户权限、高级用户权限、管理员权限和超级管理员权限中的任意一项或任意多项。其中,不同监控权限可以对应不同的监控界面,比如普通用户权限对应的监控界面仅用于展示监控数据,高级用户权限对应的监控界面用于展示监控数据,同时还可以展示监控数据所属的监控对象的安全程度,管理员权限对应的监控界面用于展示监控数据、监控数据所属的监控对象的安全程度,同时还可以支持用户配置监控任务、预警规则等,超级管理员权限对应的监控界面可以用于管理和维护各个用户的监控界面。In an example, the monitoring system 110 stores a corresponding relationship between identity information and monitoring authority, and the corresponding relationship includes each identity information registered in the monitoring system in advance and the monitoring authority corresponding to each identity information, and the monitoring authority corresponding to each identity information It can be any one or more of ordinary user rights, advanced user rights, administrator rights, and super administrator rights. Among them, different monitoring permissions can correspond to different monitoring interfaces. For example, the monitoring interface corresponding to ordinary user permissions is only used to display monitoring data, and the monitoring interface corresponding to advanced user permissions is used to display monitoring data, and it can also display the monitoring objects to which the monitoring data belongs. The monitoring interface corresponding to the administrator authority is used to display the monitoring data and the security level of the monitored object to which the monitoring data belongs. It can also support users to configure monitoring tasks, early warning rules, etc., the monitoring interface corresponding to the super administrator authority can be used It is used to manage and maintain the monitoring interface of each user.
如此,当监控系统110解析得到用户的身份信息后,可以先根据用户的身份信息查询身份信息与监控权限的对应关系,若该对应关系中不存在用户的身份信息,则说明该用户未在监控系统110中注册,因此监控系统110可以向客户端120发送鉴权失败的响应消息;相应地,若该对应关系中存在用户的身份信息,则说明该用户已在监控系统110中注册,因此监控系统110可以先确定用户的身份信息对应的监控权限,再将该监控权限对应的监控界面作为用户对应的监控界面。In this way, after the monitoring system 110 parses and obtains the user’s identity information, it can first query the corresponding relationship between the identity information and the monitoring authority based on the user’s identity information. If the user’s identity information does not exist in the corresponding relationship, it means that the user is not monitoring. Is registered in the system 110, so the monitoring system 110 can send a response message that the authentication fails to the client 120; accordingly, if the user’s identity information exists in the corresponding relationship, it means that the user has been registered in the monitoring system 110, so the monitoring The system 110 may first determine the monitoring authority corresponding to the user's identity information, and then use the monitoring interface corresponding to the monitoring authority as the monitoring interface corresponding to the user.
步骤f,监控系统110将用户对应的监控界面发送给客户端120。In step f, the monitoring system 110 sends the monitoring interface corresponding to the user to the client 120.
步骤g,客户端120通过web浏览器显示用户对应的监控界面。In step g, the client 120 displays a monitoring interface corresponding to the user through a web browser.
步骤h,客户端120获取用户在监控界面中输入或选择的配置信息,并根据配置信息生成监控请求。Step h: The client 120 obtains the configuration information input or selected by the user in the monitoring interface, and generates a monitoring request according to the configuration information.
其中,配置信息中可以包括待监控主机的标识,还可以包括待监控对象、监控任务的触发条件、预警规则和监控界面的展示配置中的任意一项或任意多项,待监控对象是指待监控的资源,比如内存或磁盘,监控任务的触发条件可以为监控任务的执行时刻和/或执行 周期,监控界面的展示配置可以为展示在监控界面中的监控数据类型。Among them, the configuration information can include the identification of the host to be monitored, and can also include any one or more of the object to be monitored, the triggering condition of the monitoring task, the early warning rules, and the display configuration of the monitoring interface. The object to be monitored refers to the display configuration of the monitoring interface. Monitoring resources, such as memory or disk, the triggering condition of the monitoring task can be the execution time and/or execution period of the monitoring task, and the display configuration of the monitoring interface can be the type of monitoring data displayed in the monitoring interface.
步骤202,根据所述待监控主机的标识,获取所述待监控主机的资源配置信息。Step 202: Obtain resource configuration information of the host to be monitored according to the identifier of the host to be monitored.
本发明实施例中,监控系统110还可以对接待监控业务系统中的配置管理数据库(Configuration Management Database,CMDB)系统,CMDB系统中存储有待监控业务系统中的每个主机的资源配置信息,比如每个主机的国际互联协议(Internet Protocol,IP)地址、运行的操作系统、操作系统的版本、开设的开放端口号和关闭端口号、每个端口号的生命周期、每个开放端口号提供的服务,等等。In the embodiment of the present invention, the monitoring system 110 may also perform configuration management database (CMDB) system in the reception monitoring service system. The CMDB system stores the resource configuration information of each host in the service system to be monitored, such as each Internet Protocol (IP) address of each host, operating operating system, operating system version, open and closed port numbers, life cycle of each port number, and services provided by each open port number ,and many more.
具体实施中,当监控系统110解析监控请求得到待监控主机的标识后,可以向CMDB系统发送查询请求,并在查询请求中携带待监控主机的标识;相应地,CMDB系统接收到查询请求后,可以先解析查询请求得到待监控主机的标识,再根据待监控主机的标识查询内置的CMDB,得到待监控主机的资源配置信息,并发送给监控系统110。In specific implementation, after the monitoring system 110 parses the monitoring request to obtain the identification of the host to be monitored, it can send a query request to the CMDB system, and carry the identification of the host to be monitored in the query request; accordingly, after the CMDB system receives the query request, The query request can be parsed to obtain the identification of the host to be monitored, and then the built-in CMDB can be queried according to the identification of the host to be monitored to obtain the resource configuration information of the host to be monitored and sent to the monitoring system 110.
需要说明的是,上述仅是一种示例性的简单说明,并不构成对方案的限定,在具体实施中,监控系统110也可以从CMDB系统中获取并存储CMDB,从而在接收到监控请求后,直接查询内部存储的CMDB获取待监控主机的资源配置信息,且,监控系统110还可以实时或周期性地更新CMDB。It should be noted that the above is only an exemplary simple description, and does not constitute a limitation on the solution. In specific implementation, the monitoring system 110 can also obtain and store the CMDB from the CMDB system, so that after receiving the monitoring request , Directly query the internally stored CMDB to obtain the resource configuration information of the host to be monitored, and the monitoring system 110 can also update the CMDB in real time or periodically.
在一个示例中,CMDB系统中还可以存储有各个主机所属的主机群,如此,若监控请求中携带有待监控主机群的标识,则监控系统110可以根据待监控主机群的标识,从CMDB系统中获取待监控主机群中部署的各个主机和各个主机的资源配置信息,而无需在监控请求中携带每个待监控主机的标识,降低数据传输量,提高监控效率。In an example, the CMDB system may also store the host group to which each host belongs. In this way, if the monitoring request carries the identifier of the host group to be monitored, the monitoring system 110 may obtain the information from the CMDB system according to the identifier of the host group to be monitored. Obtain each host deployed in the host group to be monitored and the resource configuration information of each host without the need to carry the identification of each host to be monitored in the monitoring request, which reduces the amount of data transmission and improves the monitoring efficiency.
步骤203,确定与所述待监控主机的资源配置信息匹配的监控插件。Step 203: Determine a monitoring plug-in matching the resource configuration information of the host to be monitored.
本发明实施例中,监控系统110中封装有各种资源配置信息对应的监控插件,当确定待监控主机的资源配置信息后,监控系统110可以先计算待监控主机的资源配置信息与已封装的各种资源配置信息的相似度,然后选取相似度大于设定相似度的资源配置信息作为待监控主机的资源配置信息匹配的资源配置信息,并将匹配的资源配置信息对应的监控插件确定为待监控主机对应的监控插件。In the embodiment of the present invention, monitoring plug-ins corresponding to various resource configuration information are encapsulated in the monitoring system 110. After determining the resource configuration information of the host to be monitored, the monitoring system 110 may first calculate the resource configuration information of the host to be monitored and the encapsulated information. The similarity of various resource configuration information, and then select the resource configuration information with the similarity greater than the set similarity as the resource configuration information matching the resource configuration information of the host to be monitored, and determine the monitoring plug-in corresponding to the matching resource configuration information as the waiting The monitoring plug-in corresponding to the monitoring host.
其中,若存在多个匹配的资源配置信息,则监控系统110可以随机选取一个匹配的资源配置信息作为待监控主机的资源配置信息匹配的资源配置信息,也可以选取相似度最大的资源配置信息作为待监控主机的资源配置信息匹配的资源配置信息,具体不作限定。Among them, if there are multiple matching resource configuration information, the monitoring system 110 can randomly select a matching resource configuration information as the resource configuration information matching the resource configuration information of the host to be monitored, or select the resource configuration information with the greatest similarity as the resource configuration information. The resource configuration information that matches the resource configuration information of the host to be monitored is not specifically limited.
在一个示例中,若监控请求中还包括待监控对象,则监控系统110还可以根据待监控对象和各个监控插件对应的监控对象,从各个监控插件中选取出监控对象与待监控对象匹配的备选监控插件,再根据备选监控插件对应的资源配置信息和待监控主机的资源配置信息,从备选监控插件中选取资源配置信息的相似度与待监控主机的资源配置信息的相似度大于设定相似度的目标监控插件,将目标监控插件作为待监控主机对应的监控插件;或者,监控系统110也可以先根据各个监控插件对应的资源配置信息和待监控主机的资源配置信息,从各个监控插件中选取资源配置信息的相似度与待监控主机的资源配置信息的相似度大于设定相似度的备选监控插件,再根据待监控对象和备选监控插件对应的监控对象,从备选监控插件中选取出监控对象与待监控对象匹配的目标监控插件,将目标监控插件作为待监控主机对应的监控插件。In an example, if the monitoring request also includes the object to be monitored, the monitoring system 110 may also select the equipment that matches the monitored object and the object to be monitored from each monitoring plug-in according to the object to be monitored and the monitoring object corresponding to each monitoring plug-in. Select the monitoring plug-in, and then according to the resource configuration information corresponding to the candidate monitoring plug-in and the resource configuration information of the host to be monitored, select the resource configuration information from the candidate monitoring plug-in. The similarity of the resource configuration information to the resource configuration information of the host to be monitored is greater than the setting Determine the similarity of the target monitoring plug-in, and use the target monitoring plug-in as the monitoring plug-in corresponding to the host to be monitored; alternatively, the monitoring system 110 may firstly select the resource configuration information corresponding to each monitoring plug-in and the resource configuration information of the host to be monitored from each monitoring plug-in. The similarity between the resource configuration information selected in the plug-in and the resource configuration information of the host to be monitored is greater than that of the candidate monitoring plug-in whose similarity is set, and then according to the monitoring object corresponding to the object to be monitored and the candidate monitoring plug-in, select from the candidate monitoring The target monitoring plugin that matches the monitoring object and the target to be monitored is selected from the plugin, and the target monitoring plugin is used as the monitoring plugin corresponding to the host to be monitored.
在一种可能的实现方式中,监控系统110还可以支持用户自定义监控插件,当监控系统110中已有的监控插件不满足用户的需求时,用户即可自定义监控插件。其中,自定义 的监控插件可以基于自定义的脚本文件进行设置,也可以基于监控系统中已有的监控插件进行设置,还可以基于第三方设备的监控插件进行设置,不作限定。In a possible implementation manner, the monitoring system 110 may also support user-defined monitoring plug-ins. When the existing monitoring plug-ins in the monitoring system 110 do not meet the needs of the user, the user can customize the monitoring plug-ins. Among them, the custom monitoring plug-in can be set based on a custom script file, can also be set based on the existing monitoring plug-in in the monitoring system, or can be set based on the monitoring plug-in of a third-party device, without limitation.
下面描述一种自定义监控插件的具体实施流程:The following describes the specific implementation process of a custom monitoring plug-in:
步骤一,接收插件配置请求,所述插件配置请求中包括待生成的监控插件对应的资源配置信息和监控值的输出规则。Step 1: Receive a plug-in configuration request, where the plug-in configuration request includes resource configuration information and monitoring value output rules corresponding to the monitoring plug-in to be generated.
其中,插件配置请求中还可以包括待生成的监控插件的标识。待生成的监控插件对应的资源配置信息可以为待生成的监控插件适用的操作系统和发行版本,监控值的输出规则可以为监控值的输出格式。Wherein, the plug-in configuration request may also include the identification of the monitoring plug-in to be generated. The resource configuration information corresponding to the monitoring plug-in to be generated may be the operating system and release version applicable to the monitoring plug-in to be generated, and the output rule of the monitoring value may be the output format of the monitoring value.
具体实施中,插件配置请求可以由用户在监控界面上进行输入或选择,比如当用户在监控界面上点击“新建监控插件”的功能图标后,监控系统110可以通过客户端120向用户显示标识输入框、输出规则输入框、操作系统选择框和发行版本选择框,标识输入框用于用户输入待生成的监控插件的标识,输出规则输入框用于用户定义监控值的输出格式,操作系统选择框用于用户选择待生成的监控插件适用的操作系统,发行版本选择框用于用户选择待生成的监控插件适用操作系统的发行版本。当监测到用户操作完成后,监控系统110可以根据用户输入的标识和输出规则、用户选择的操作系统和发行版本,生成插件配置请求。In specific implementation, the plug-in configuration request can be input or selected by the user on the monitoring interface. For example, when the user clicks the function icon of "New Monitoring Plug-in" on the monitoring interface, the monitoring system 110 can display the identification input to the user through the client 120 Box, output rule input box, operating system selection box and release version selection box. The identification input box is used for the user to input the identification of the monitoring plug-in to be generated, the output rule input box is used for the user to define the output format of the monitoring value, the operating system selection box It is used for the user to select the operating system for the monitoring plug-in to be generated, and the release version selection box is used for the user to select the release version of the operating system for the monitoring plug-in to be generated. After monitoring that the user operation is completed, the monitoring system 110 may generate a plug-in configuration request according to the identification and output rules input by the user, the operating system and release version selected by the user.
步骤二,获取待生成的监控插件的初始脚本文件。Step 2: Obtain the initial script file of the monitoring plug-in to be generated.
具体实施中,若待生成的监控插件基于用户编写的脚本文件进行设置,则监控系统110可以通过与客户端120的交互获取用户在监控界面上上传的脚本文件,并作为待生成的监控插件的初始脚本文件;若待生成的监控插件基于监控系统110中已有的监控插件进行设置,则监控系统110可以通过客户端将监控系统110中的全部已有监控插件的标识显示给用户,并获取用户选择的一个或多个已有监控插件的脚本文件,作为待生成的监控插件的初始脚本文件;若待生成的监控插件基于第三方设备中的监控插件进行设置,则监控系统110可以先获取用户输入的第三方监控插件的标识,再通过与第三方设备的通信交互获取第三方监控插件的脚本文件,作为待生成的监控插件的初始脚本文件。In specific implementation, if the monitoring plug-in to be generated is set based on a script file written by the user, the monitoring system 110 can obtain the script file uploaded by the user on the monitoring interface through interaction with the client 120, and use it as the monitoring plug-in to be generated. Initial script file; if the monitoring plug-in to be generated is set based on the existing monitoring plug-ins in the monitoring system 110, the monitoring system 110 can display the identifications of all existing monitoring plug-ins in the monitoring system 110 to the user through the client, and obtain One or more script files of the existing monitoring plug-in selected by the user are used as the initial script file of the monitoring plug-in to be generated; if the monitoring plug-in to be generated is set based on the monitoring plug-in in the third-party device, the monitoring system 110 can obtain it first The identifier of the third-party monitoring plug-in entered by the user is then obtained through communication and interaction with the third-party device, and the script file of the third-party monitoring plug-in is obtained as the initial script file of the monitoring plug-in to be generated.
步骤三,按照监控值的输出规则对初始脚本文件进行修正,得到待生成的监控插件的脚本文件;待生成的监控插件的脚本文件在运行时输出的监控值满足监控值的输出规则。Step 3: Correct the initial script file according to the output rule of the monitoring value to obtain the script file of the monitoring plug-in to be generated; the monitoring value output by the script file of the monitoring plug-in to be generated at runtime meets the output rule of the monitoring value.
具体实施中,若输出规则为输出的监控值满足设定监控值格式,则监控系统110可以先从初始脚本文件中确定出功能为“输出监控值”的类函数,再确定按照类函数执行时输出的初始监控值格式,若初始监控值格式与设定监控值格式不同,则可以按照设定监控值格式对类函数进行修改,以实现按照类函数执行时监控插件能够按照设定监控值格式输出监控值;相应地,若初始监控值格式与设定监控值格式相同,则可以不对类函数进行修改。In specific implementation, if the output rule is that the output monitoring value satisfies the set monitoring value format, the monitoring system 110 may first determine the function of the "output monitoring value" type function from the initial script file, and then determine when the function is executed according to the type function. The output initial monitoring value format, if the initial monitoring value format is different from the set monitoring value format, the class function can be modified according to the set monitoring value format, so that the monitoring plug-in can follow the set monitoring value format when executing according to the class function Output monitoring value; accordingly, if the format of the initial monitoring value is the same as the format of the set monitoring value, the class function need not be modified.
需要说明的是,监控系统110还可以对其它配置信息进行修改,比如当待生成的监控插件基于第三方监控插件生成时,若要求待生成的监控插件的标识为设定标识,则监控系统110还可以根据待生成的监控插件的初始脚本文件的标识、类函数标识或方法标识确定第三方监控插件的标识,若第三方插件的标识与设定标识不同,则可以将初始脚本文件的标识、类函数标识或方法标识修改为设定标识。It should be noted that the monitoring system 110 can also modify other configuration information. For example, when the monitoring plug-in to be generated is generated based on a third-party monitoring plug-in, if the identifier of the monitoring plug-in to be generated is required to be a set identifier, the monitoring system 110 The identification of the third-party monitoring plug-in can also be determined according to the identification of the initial script file, class function identification, or method identification of the monitoring plug-in to be generated. If the identification of the third-party plug-in is different from the set identification, the identification of the initial script file, The class function ID or method ID is modified to the set ID.
步骤四,根据待生成的监控插件的脚本文件和待生成的监控插件对应的资源配置信息,生成待生成的监控插件。Step 4: Generate the monitoring plug-in to be generated according to the script file of the monitoring plug-in to be generated and the resource configuration information corresponding to the monitoring plug-in to be generated.
此处,在生成待生成的监控插件后,还可以将待生成的监控插件封装在监控系统110 中,以使待生成的监控插件成为监控系统110中的已有监控插件。如此,若后续需要使用该监控插件,则监控系统110可以直接调用该监控插件,或者用户可以从监控界面中选择该监控插件,而无需再重新创建该监控插件,从而可以降低无用操作,提高监控效率。Here, after the monitoring plug-in to be generated is generated, the monitoring plug-in to be generated can also be packaged in the monitoring system 110, so that the monitoring plug-in to be generated becomes an existing monitoring plug-in in the monitoring system 110. In this way, if the monitoring plug-in needs to be used later, the monitoring system 110 can directly call the monitoring plug-in, or the user can select the monitoring plug-in from the monitoring interface without recreating the monitoring plug-in, thereby reducing useless operations and improving monitoring effectiveness.
在一个示例中,监控系统110中可以同时封装有linux操作系统、Windows操作系统、Mac OS X操作系统和伯克利软件套件(Berkeley Software Distribution,BSD)操作系统的各个发行版本对应的监控插件,比如centos6.8版本的linux操作系统对应的监控插件、Windows1.0版本的Windows操作系统对应的监控插件,等等。在该示例中,通过封装各种资源配置信息对应的监控插件,使得监控系统可以适用于各种场景,主机监控的灵活性较好。In an example, the monitoring system 110 may simultaneously encapsulate the monitoring plug-ins corresponding to each release version of the Linux operating system, the Windows operating system, the Mac OS X operating system, and the Berkeley Software Distribution (BSD) operating system, such as centos6 The monitoring plug-in corresponding to the .8 version of the linux operating system, the monitoring plug-in corresponding to the Windows operating system of the Windows version 1.0, and so on. In this example, by encapsulating the monitoring plug-ins corresponding to various resource configuration information, the monitoring system can be applied to various scenarios, and the flexibility of host monitoring is better.
步骤204,使用所述监控插件监控所述待监控主机,得到所述待监控主机在当前时刻的监控值。Step 204: Use the monitoring plug-in to monitor the host to be monitored, and obtain the monitoring value of the host to be monitored at the current moment.
本发明实施例中,若监控请求还用于指示显示监控值,则监控系统110还可以根据监控值生成显示界面,并将显示界面发送给客户端120;相应地,客户端120接收到显示界面后,可以在web浏览器上将显示界面显示给用户,以便于用户从显示界面中查看到监控值。In the embodiment of the present invention, if the monitoring request is also used to indicate the display of the monitoring value, the monitoring system 110 may also generate a display interface according to the monitoring value, and send the display interface to the client 120; accordingly, the client 120 receives the display interface Later, the display interface can be displayed to the user on the web browser, so that the user can view the monitored value from the display interface.
在一种可能的实现方式中,在得到待监控主机在当前时刻的监控值后,监控系统110还可以将当前时刻的监控值存储到监控数据库中,以实现对监控值的备份。其中,监控数据库用于存储各个主机的历史监控值,监控数据库的类型可以由本领域技术人员根据经验进行设置,比如可以为关系型数据库,也可以为非关系型数据库,还可以为Hoodap数据库,不作限定。In a possible implementation manner, after obtaining the monitoring value of the host to be monitored at the current moment, the monitoring system 110 may also store the current monitoring value in the monitoring database to realize the backup of the monitoring value. Among them, the monitoring database is used to store the historical monitoring values of each host. The type of the monitoring database can be set by those skilled in the art based on experience. For example, it can be a relational database, a non-relational database, or a Hoodap database. limited.
具体实施中,监控系统110还可以联合监控数据库中该主机在监控对象下的历史监控值拟合预测模型,并使用预测模型预测未来时段内该主机在监控对象下的值的变化情况,预判主机风险。其中,拟合模型可以为以时间为自变量、以资源使用率或负载情况为因变量的数据模型,拟合模型能够预测未来时段内的资源消耗情况或负载占用情况,若根据拟合模型确定未来时段内会出现资源消耗过量或负载占用超重的问题,则监控系统110还可以对主机进行预警,以便于用户提前检修主机,避免主机故障。In specific implementation, the monitoring system 110 can also jointly monitor the historical monitoring value of the host under the monitoring object in the monitoring database to fit a prediction model, and use the prediction model to predict the change in the value of the host under the monitoring object in the future period. Host risk. Among them, the fitting model can be a data model with time as an independent variable and resource usage or load situation as a dependent variable. The fitting model can predict resource consumption or load occupancy in the future period. If determined according to the fitting model In the future, the problem of excessive resource consumption or excessive load occupation will occur, and the monitoring system 110 may also give an early warning to the host, so that the user can repair the host in advance and avoid host failure.
在一个示例中,在拟合预测模型时,监控系统110可以先确定监控值对应的监控对象,再使用监控对象对应的拟合算法对监控数据库中的历史监控值进行拟合,得到预测模型。其中,监控对象对应的拟合算法可以基于监控对象在历史时段的历史监控值的变化规律统计得到,比如若监控对象在历史时段的历史监控值的变化规律符合线性变化规律,则可以将监控对象对应的拟合算法设置为线性回归算法,若监控对象对应的历史监控值的变化规律符合周期性变化规律,则可以将监控对象对应的拟合算法设置为周期匹配算法。In one example, when fitting the prediction model, the monitoring system 110 may first determine the monitoring object corresponding to the monitoring value, and then use the fitting algorithm corresponding to the monitoring object to fit the historical monitoring value in the monitoring database to obtain the prediction model. Among them, the fitting algorithm corresponding to the monitored object can be calculated based on the change rule of the historical monitoring value of the monitored object in the historical period. For example, if the change rule of the historical monitoring value of the monitored object in the historical period conforms to the linear change rule, the monitored object can be The corresponding fitting algorithm is set as a linear regression algorithm. If the change rule of the historical monitoring value corresponding to the monitored object conforms to the periodic change rule, the fitting algorithm corresponding to the monitored object can be set as a period matching algorithm.
下面介绍两种可能的拟合算法。Two possible fitting algorithms are described below.
线性回归算法Linear regression algorithm
本发明实施例中,线性回归算法对应的监控对象具有如下规律:监控对象在历史时段的历史监控值呈线性变化,比如直线递增,或者直线递减。举例来说,当监控对象为磁盘使用量时,由于磁盘的使用量会随着时间呈直线递增变化,因此磁盘使用量对应的拟合算法可以为线性回归算法。In the embodiment of the present invention, the monitoring object corresponding to the linear regression algorithm has the following law: the historical monitoring value of the monitoring object in the historical period changes linearly, such as linear increase or linear decrease. For example, when the monitoring object is the disk usage, since the disk usage will increase linearly with time, the fitting algorithm corresponding to the disk usage may be a linear regression algorithm.
以一元线性回归算法为例,具体实施中,在确定出监控值对应的监控对象后,监控系统110可以从监控数据库中获取监控对象在设定时段内的历史监控数据(包括当前时刻的 监控值)。由于通常采用离散监控方式采集主机的监控值,因此设定时段内的历史监控数据中可以包括各个时刻的历史监控值,如此,监控系统110可以先设置初始线性回归模型,并将各个时刻的历史监控值代入初始线性回归模型,以得到初始线性回归模型中的多个未知参数的值,如此,监控系统110可以基于初始线性回归模型和多个未知参数的值构建监控对象对应的一元线性回归模型(即预测模型)。其中,在将各个时刻的历史监控值代入初始线性回归模型时,监控系统110也可以基于最小二乘法对设定时段内各个时刻的历史监控值进行计算,以确定出多个未知参数的值,得到一元线性回归模型。Taking the unary linear regression algorithm as an example, in specific implementation, after determining the monitored object corresponding to the monitored value, the monitoring system 110 can obtain the historical monitoring data of the monitored object within a set period of time from the monitoring database (including the current monitoring value ). Since the monitoring value of the host is usually collected in a discrete monitoring method, the historical monitoring data within a set period of time can include the historical monitoring value of each time. In this way, the monitoring system 110 can first set the initial linear regression model and compare the historical monitoring data of each time. The monitored value is substituted into the initial linear regression model to obtain the values of multiple unknown parameters in the initial linear regression model. In this way, the monitoring system 110 can construct a univariate linear regression model corresponding to the monitored object based on the initial linear regression model and the values of the multiple unknown parameters (I.e. predictive model). Wherein, when the historical monitoring value at each time is substituted into the initial linear regression model, the monitoring system 110 may also calculate the historical monitoring value at each time within the set time period based on the least square method to determine the values of multiple unknown parameters. Obtain a univariate linear regression model.
在一个示例中,在对设定时段内各个时刻的历史监控值进行计算之前,还可以对设定时段的历史监控数据中缺失的历史监控值或非法的历史监控值(比如历史监控值的类型为字符、标点符号,或其它非数值型)进行补全操作,补全操作使用的补全值可以为缺失的或非法的历史监控值的前一时刻和后一时刻的历史监控值的平均值,也可以为各个时刻的历史监控值的平均值,还可以为各个时刻的历史监控值的加权平均值,各个时刻的历史监控值对应的权重与距离当前时刻的时差呈正相关,具体不作限定。In one example, before calculating the historical monitoring value at each time within the set period, the historical monitoring value missing or illegal historical monitoring value (such as the type of historical monitoring value) in the historical monitoring data of the set period can also be calculated. Perform completion operations for characters, punctuation marks, or other non-numeric values. The completion value used in the completion operation can be the average of the previous and next historical monitoring values of the missing or illegal historical monitoring values. , It can also be the average value of the historical monitoring value at each time, or the weighted average of the historical monitoring value at each time, the weight corresponding to the historical monitoring value at each time is positively correlated with the time difference from the current time, which is not specifically limited.
本发明实施例中,当确定出监控对象对应的线性回归模型后,可以使用线性回归模型预测预警条件中监控阈值的出现时刻,若监控对象的监控值不会达到监控阈值,则说明监控对象在未来时段内处于安全状态,可以不作处理;若存在某一时刻监控对象的监控值可能会达到监控阈值,则可以根据监控对象和该时刻生成预警消息,并在该时刻之前向客户端发送预警消息,以提前预警,避免监控对象在未来时段的值超过监控阈值,保证资源使用量不超标或者负载不超重。In the embodiment of the present invention, after the linear regression model corresponding to the monitored object is determined, the linear regression model can be used to predict the occurrence time of the monitoring threshold in the early warning condition. If the monitored value of the monitored object does not reach the monitoring threshold, it means that the monitored object is in In the future, it is in a safe state and does not need to be processed; if there is a monitoring value of the monitored object at a certain moment that may reach the monitoring threshold, an early warning message can be generated according to the monitored object and that time, and an early warning message can be sent to the client before that time , In order to provide early warning to prevent the value of the monitored object from exceeding the monitoring threshold in the future period, and to ensure that the resource usage does not exceed the standard or the load is not overweight.
周期匹配算法Period matching algorithm
本发明实施例中,周期匹配算法对应的监控对象具有如下规律:监控对象在历史时段的历史监控值呈固定周期或非固定周期变化。举例来说,当监控对象为中央处理器(central processing unit,CPU)使用率时,由于CPU使用率会随着用户每次开机后的使用时长的增长呈逐渐递增的变化规律,因此,CPU使用率对应的拟合算法为周期匹配算法。In the embodiment of the present invention, the monitoring object corresponding to the period matching algorithm has the following law: the historical monitoring value of the monitoring object in the historical period changes in a fixed or non-fixed period. For example, when the monitoring object is the central processing unit (CPU) usage rate, since the CPU usage rate will gradually increase with the increase of the user’s usage time each time the user turns on, the CPU usage The fitting algorithm corresponding to the rate is the period matching algorithm.
其中,周期匹配算法可以包括固定周期匹配算法和非固定周期匹配算法,固定周期匹配算法是指监控对象在历史时段的历史监控值按照固定周期的变化规律出现,比如每次变化规律均对应10小时的周期时长;相应地,非固定周期匹配算法是指监控对象在历史时段的历史监控值按照非固定周期的变化规律出现,虽然在不同周期内历史监控值的变化规律整体相同,但是每次变化规律对应的周期时长不同,比如某次变化规律对应10小时的周期时长,而另一次变化规律对应20小时的周期时长。Among them, the period matching algorithm can include a fixed period matching algorithm and a non-fixed period matching algorithm. The fixed period matching algorithm means that the historical monitoring value of the monitored object in the historical period appears according to the change rule of a fixed period, for example, each change rule corresponds to 10 hours Correspondingly, the non-fixed-period matching algorithm means that the historical monitoring value of the monitored object in the historical period appears according to the non-fixed period of change. Although the change of the historical monitoring value in different periods is the same, each time it changes The period of time corresponding to the law is different, for example, a certain change rule corresponds to a period of 10 hours, and another change rule corresponds to a period of 20 hours.
以固定性周期匹配算法为例,具体实施中,在确定出监控值对应的监控对象后,若固定周期为T,则监控系统110先从监控数据库中获取包含当前时刻的监控值在内的时长为T的第一历史监控数据,并可以采用滑窗方式从监控数据库中获取时长为T的各个第二历史监控数据,然后计算第一历史监控数据和各个第二历史监控数据的相似度,将相似度大于相似度阈值的第二历史监控数据作为第一历史监控数据对应的周期匹配模型。其中,计算相似度的方式可以由本领域技术人员根据经验进行设置,比如可以采用欧几里得距离算法、余弦相似度算法或欧式距相似度算法中的任意一项或任意多项计算相似度,具体不作限定。Taking the fixed period matching algorithm as an example, in specific implementation, after determining the monitoring object corresponding to the monitoring value, if the fixed period is T, the monitoring system 110 first obtains the duration including the monitoring value at the current moment from the monitoring database Is the first historical monitoring data of T, and each second historical monitoring data with a duration of T can be obtained from the monitoring database in a sliding window method, and then the similarity between the first historical monitoring data and each second historical monitoring data is calculated, and The second historical monitoring data whose similarity is greater than the similarity threshold is used as the period matching model corresponding to the first historical monitoring data. The method of calculating the similarity can be set by those skilled in the art based on experience. For example, any one or more of the Euclidean distance algorithm, the cosine similarity algorithm or the Euclidean distance similarity algorithm can be used to calculate the similarity. The details are not limited.
本发明实施例中,当确定出监控对象对应的周期匹配模型(即相似度大于相似度阈值的第二历史监控数据)后,可以先确定第二历史监控数据的各个时刻的历史监控值中是否 存在某一时刻的历史监控值达到预警条件中的监控阈值,若各个时刻的历史监控值均未达到监控阈值,则说明监控对象在周期时段内处于安全状态,可以不作处理;若存在某一时刻(为了便于描述,称为目标时刻)的历史监控值达到监控阈值,则可以基于第二历史监控数据对应的周期时段的起始时刻和第一历史监控数据对应的周期时段的起始时刻的时差,对目标时刻进行修正,以确定出目标时刻对应的未来时刻,并可以根据监控对象和未来时刻生成预警消息,在未来时刻之前向客户端发送预警消息,以提前预警,避免监控对象在未来时段的值超过监控阈值,保证资源使用量不超标或者负载不超重。In the embodiment of the present invention, after determining the period matching model corresponding to the monitored object (that is, the second historical monitoring data whose similarity is greater than the similarity threshold), it can first be determined whether the historical monitoring value of the second historical monitoring data at each time is There is a historical monitoring value at a certain moment that reaches the monitoring threshold in the early warning condition. If the historical monitoring value at each time does not reach the monitoring threshold, it means that the monitored object is in a safe state during the period of time, and no processing is required; if there is a certain moment (For ease of description, referred to as the target time) when the historical monitoring value reaches the monitoring threshold, it can be based on the time difference between the start time of the period corresponding to the second historical monitoring data and the start time of the period corresponding to the first historical monitoring data , Correct the target moment to determine the future moment corresponding to the target moment, and can generate an early warning message according to the monitored object and the future moment, and send an early warning message to the client before the future moment to give early warning to avoid the monitored object in the future period The value exceeds the monitoring threshold to ensure that the resource usage does not exceed the standard or the load is not overweight.
图3为本发明实施例提供的一种监控系统的架构示意图,如图3所示,监控系统110中可以设置有相互连接的控制配置中心、任务执行中心和数据中心,控制配置中心还可以连接客户端120,任务执行中心还可以连接各个主机,连接的方式可以为有线连接,也可以为无线连接,具体不作限定。FIG. 3 is a schematic diagram of the architecture of a monitoring system provided by an embodiment of the present invention. As shown in FIG. 3, the monitoring system 110 may be provided with a control configuration center, a task execution center, and a data center that are connected to each other, and the control configuration center may also be connected The client 120 and the task execution center may also be connected to each host, and the connection mode may be a wired connection or a wireless connection, which is not specifically limited.
如图3所示,控制配置中心中可以设置有相互连接的界面管理单元、权限管理单元、设备管理单元和配置管理单元,界面管理单元还与客户端120连接;任务执行中心中可以设置有相互连接的任务调度单元、插件管理单元和任务执行单元,任务调度单元还连接配置管理单元,任务执行单元还连接各个主机;数据中心中可以设置有数据处理单元和监控数据库,数据处理单元还连接任务执行单元和界面管理单元。As shown in Figure 3, the control configuration center can be provided with interconnected interface management units, rights management units, equipment management units, and configuration management units. The interface management unit is also connected to the client 120; the task execution center can be provided with mutual interface management units, rights management units, equipment management units, and configuration management units. The task scheduling unit, plug-in management unit and task execution unit are connected. The task scheduling unit is also connected to the configuration management unit, and the task execution unit is also connected to each host; the data center can be equipped with a data processing unit and a monitoring database, and the data processing unit is also connected to tasks Execution unit and interface management unit.
具体实施中,用户可以通过客户端120向界面管理单元发送登录界面请求消息,登录界面请求消息中携带有用户的标识,如此,当界面管理单元解析登录界面请求消息得到用户的标识后,可以将用户的标识发送给权限管理单元,以获取权限管理单元根据用户的标识确定的监控权限,从而界面管理单元可以将监控权限对应的监控界面发送给客户端120,以使客户端120将监控界面显示给用户。In specific implementation, the user can send a login interface request message to the interface management unit through the client 120. The login interface request message carries the user's identity. In this way, after the interface management unit parses the login interface request message to obtain the user's identity, it can send the login interface request message to the interface management unit. The user's identification is sent to the authority management unit to obtain the monitoring authority determined by the authority management unit according to the user's identifier, so that the interface management unit can send the monitoring interface corresponding to the monitoring authority to the client 120, so that the client 120 displays the monitoring interface To the user.
进一步地,用户可以在监控界面上选择待监控主机,并可以输入触发条件,而客户端120检测到用户输入完成后,可以生成监控请求,并在监控请求中携带待监控主机的标识和触发条件,将监控请求发送给界面管理单元,以经由界面管理单元发送给配置管理单元。相应地,配置管理单元解析监控请求得到待监控主机的标识和触发条件后,可以先根据待监控主机的标识从设备管理单元对接的CMDB数据库(即配置管理数据库)中获取待监控主机对应的资源配置信息,再根据待监控主机的标识、待监控主机对应的资源配置信息和触发条件生成对应的监控任务,发送给任务调度单元。Further, the user can select the host to be monitored on the monitoring interface, and can input the trigger condition, and the client 120 can generate a monitoring request after detecting that the user input is completed, and carry the identification of the host to be monitored and the trigger condition in the monitoring request , The monitoring request is sent to the interface management unit, so as to be sent to the configuration management unit via the interface management unit. Correspondingly, after the configuration management unit parses the monitoring request to obtain the identification and trigger condition of the host to be monitored, it can first obtain the resources corresponding to the host to be monitored from the CMDB database (ie configuration management database) docked with the device management unit according to the identification of the host to be monitored. The configuration information generates a corresponding monitoring task according to the identification of the host to be monitored, the resource configuration information corresponding to the host to be monitored, and the trigger condition, and sends it to the task scheduling unit.
相应地,任务调度单元若确定当前时刻满足监控任务的触发条件,则可以将待监控主机的标识和待监控主机对应的资源配置信息发送给任务处理单元,而任务处理单元可以根据待监控主机对应的资源配置信息从插件管理单元中获取匹配的监控插件,调用匹配的监控插件对待监控主机进行监控,得到待监控主机在当前时刻的监控值;且,任务处理单元还可以将待监控主机在当前时刻的监控值发送给数据处理单元。Correspondingly, if the task scheduling unit determines that the trigger condition of the monitoring task is met at the current moment, it can send the identification of the host to be monitored and the resource configuration information corresponding to the host to be monitored to the task processing unit, and the task processing unit can correspond to the host to be monitored The resource configuration information from the plug-in management unit obtains the matching monitoring plug-in, calls the matching monitoring plug-in to monitor the host to be monitored, and obtains the monitoring value of the host to be monitored at the current moment; and the task processing unit can also set the host to be monitored in the current The monitoring value at the moment is sent to the data processing unit.
进一步地,数据处理单元接收到任务处理单元发送的待监控主机在当前时刻的监控值后,可以先确定监控值对应的监控对象,再从监控数据库中获取待监控主机在监控对象下的历史监控值,并使用监控对象对应的拟合算法对当前时刻的监控值和历史监控值进行拟合,得到预测模型。且,数据处理单元还可以使用预测模型确定未来时段内待监控主机在监控对象下的值是否满足预设风险条件,若满足,则说明未来时段内待监控主机的监控对象均处于安全状态,若不满足,则说明未来时段内待监控主机的监控对象可能会故障,因此数据处理单元还可以对待监控主机的监控对象生成预警消息,并可以将预警消息发送给 界面管理单元,以使界面管理单元发送给客户端120,经由客户端120的监控界面显示给用户。Further, after the data processing unit receives the monitoring value of the host to be monitored at the current moment sent by the task processing unit, it can first determine the monitoring object corresponding to the monitoring value, and then obtain the historical monitoring of the host to be monitored under the monitoring object from the monitoring database Value, and use the fitting algorithm corresponding to the monitored object to fit the current monitoring value and the historical monitoring value to obtain a prediction model. In addition, the data processing unit can also use the predictive model to determine whether the value of the host to be monitored under the monitored object meets the preset risk conditions in the future period. If it is satisfied, it means that the monitored object of the host to be monitored in the future period is in a safe state. If it is not satisfied, it means that the monitoring object of the host to be monitored may fail in the future. Therefore, the data processing unit can also generate an early warning message for the monitoring object of the host to be monitored, and can send the early warning message to the interface management unit, so that the interface management unit It is sent to the client 120 and displayed to the user via the monitoring interface of the client 120.
需要说明的是,本发明实施例中的任务执行单元可以通过远程通信协议——安全外壳协议(Secure Shell,SSH)与待监控主机进行通信,以获取待监控主机的监控值,而无需在待监控主机侧部署客户端,从而可以降低监控成本,提高监控的灵活性,降低监控系统的复杂度。It should be noted that the task execution unit in the embodiment of the present invention can communicate with the host to be monitored through a remote communication protocol-Secure Shell (SSH), so as to obtain the monitoring value of the host to be monitored, without having to be in the host. The client is deployed on the monitoring host side, which can reduce monitoring costs, increase monitoring flexibility, and reduce the complexity of the monitoring system.
本发明的上述实施例中,接收监控请求,所述监控请求中携带有待监控主机的标识,根据所述待监控主机的标识,获取所述待监控主机的资源配置信息,并确定与所述待监控主机的资源配置信息匹配的监控插件,使用所述监控插件监控所述待监控主机,得到所述待监控主机在当前时刻的监控值。本发明实施例中,通过设置各种资源配置信息对应的监控插件,使得该方案能够适用于具有不同资源配置信息的监控场合,而不用限定在固定的监控场合,从而可以提高主机监控的灵活性;且,通过使用待监控主机的资源配置信息匹配的监控插件监控待监控主机,还可以使得对待监控主机的监控更有针对性,从而提高主机监控的准确性。In the above-mentioned embodiment of the present invention, a monitoring request is received, and the monitoring request carries an identification of the host to be monitored, and according to the identification of the host to be monitored, the resource configuration information of the host to be monitored is obtained, and it is determined that it is related to the host to be monitored. The monitoring plug-in matching the resource configuration information of the monitoring host uses the monitoring plug-in to monitor the host to be monitored to obtain the monitoring value of the host to be monitored at the current moment. In the embodiment of the present invention, by setting monitoring plug-ins corresponding to various resource configuration information, the solution can be applied to monitoring occasions with different resource configuration information, instead of being limited to fixed monitoring occasions, thereby improving the flexibility of host monitoring. ; Moreover, monitoring the host to be monitored by using a monitoring plug-in matching the resource configuration information of the host to be monitored can also make the monitoring of the host to be monitored more targeted, thereby improving the accuracy of host monitoring.
针对上述方法流程,本发明实施例还提供一种监控装置,该装置的具体内容可以参照上述方法实施。In view of the foregoing method flow, an embodiment of the present invention also provides a monitoring device, and the specific content of the device can be implemented with reference to the foregoing method.
图4为本发明实施例提供的一种监控装置的结构示意图,包括:Fig. 4 is a schematic structural diagram of a monitoring device provided by an embodiment of the present invention, including:
收发模块401,用于接收监控请求,所述监控请求中携带有待监控主机的标识;The transceiver module 401 is configured to receive a monitoring request, where the monitoring request carries an identifier of the host to be monitored;
获取模块402,用于根据所述待监控主机的标识,获取所述待监控主机的资源配置信息;The obtaining module 402 is configured to obtain the resource configuration information of the host to be monitored according to the identifier of the host to be monitored;
确定模块403,用于确定与所述待监控主机的资源配置信息匹配的监控插件;The determining module 403 is configured to determine a monitoring plug-in matching the resource configuration information of the host to be monitored;
监控模块404,用于使用所述监控插件监控所述待监控主机,得到所述待监控主机在当前时刻的监控值。The monitoring module 404 is configured to monitor the host to be monitored using the monitoring plug-in to obtain the monitoring value of the host to be monitored at the current moment.
可选地,所述收发模块401还用于:接收插件配置请求,所述插件配置请求中包括所述监控插件对应的资源配置信息和监控值的输出规则;Optionally, the transceiver module 401 is further configured to: receive a plug-in configuration request, the plug-in configuration request including resource configuration information corresponding to the monitoring plug-in and output rules of monitoring values;
所述获取模块402还用于:获取所述监控插件的初始脚本文件;The obtaining module 402 is also used to obtain the initial script file of the monitoring plug-in;
所述监控模块404还用于:按照所述监控值的输出规则对所述初始脚本文件进行修正,得到所述监控插件的脚本文件,根据所述监控插件的脚本文件和所述监控插件对应的资源配置信息,生成所述监控插件;所述监控插件的脚本文件在运行时输出的监控值满足所述监控值的输出规则。The monitoring module 404 is further configured to: amend the initial script file according to the output rule of the monitoring value to obtain the script file of the monitoring plug-in, and according to the script file of the monitoring plug-in and the corresponding value of the monitoring plug-in The resource configuration information generates the monitoring plug-in; the monitoring value output by the script file of the monitoring plug-in when running meets the output rule of the monitoring value.
可选地,所述获取模块402具体用于:Optionally, the obtaining module 402 is specifically configured to:
接收客户端发送的所述监控插件的初始脚本文件,或者,从已有的监控插件中获取所述监控插件的初始脚本文件,或者,通过与第三方设备交互获取所述监控插件的初始脚本文件。Receive the initial script file of the monitoring plug-in sent by the client, or obtain the initial script file of the monitoring plug-in from an existing monitoring plug-in, or obtain the initial script file of the monitoring plug-in through interaction with a third-party device .
可选地,所述监控模块404得到所述待监控主机在当前时刻的监控值之后,还用于:Optionally, after the monitoring module 404 obtains the monitoring value of the host to be monitored at the current moment, it is further used to:
确定所述监控值对应的监控对象;Determine the monitoring object corresponding to the monitoring value;
从监控数据库中获取所述待监控主机在所述监控对象下的历史监控值;Acquiring, from a monitoring database, the historical monitoring value of the host to be monitored under the monitoring object;
使用所述监控对象对应的拟合算法对所述监控值和所述历史监控值进行拟合,得到所述待监控主机在所述监控对象下的预测模型;所述监控对象对应的拟合算法通过分析所述监控对象在历史时段的历史监控值的变化规律得到,所述预测模型用于预测未来时段内所 述待监控主机在所述监控对象下的值。Use the fitting algorithm corresponding to the monitoring object to fit the monitoring value and the historical monitoring value to obtain the prediction model of the host to be monitored under the monitoring object; the fitting algorithm corresponding to the monitoring object It is obtained by analyzing the change rule of the historical monitoring value of the monitoring object in the historical period, and the prediction model is used to predict the value of the host to be monitored under the monitoring object in the future period.
可选地,所述监控对象对应的拟合算法为线性回归算法;Optionally, the fitting algorithm corresponding to the monitored object is a linear regression algorithm;
所述监控模块404具体用于:The monitoring module 404 is specifically used for:
从所述监控数据库中获取多个时刻的历史监控值;所述多个时刻临近所述当前时刻;Acquiring historical monitoring values of multiple moments from the monitoring database; the multiple moments are close to the current moment;
设置初始预测模型,所述初始预测模型中包括多个未知参数;Setting an initial prediction model, the initial prediction model including a plurality of unknown parameters;
将所述多个时刻的历史监控值和所述当前时刻的监控值代入所述初始预测模型,以确定出所述初始预测模型中的多个未知参数的值;Substituting the historical monitoring values of the multiple moments and the monitoring values of the current moment into the initial prediction model to determine the values of multiple unknown parameters in the initial prediction model;
根据所述初始预测模型中的多个未知参数的值,构建所述预测模型。The prediction model is constructed according to the values of multiple unknown parameters in the initial prediction model.
可选地,所述监控对象对应的拟合算法为固定周期匹配算法;Optionally, the fitting algorithm corresponding to the monitored object is a fixed-period matching algorithm;
所述监控模块404具体用于:The monitoring module 404 is specifically used for:
确定所述监控对象对应的固定周期;Determine the fixed period corresponding to the monitored object;
从所述监控数据库中获取包含当前时刻的监控值在内的第一历史监控数据;所述第一历史监控数据的时长为所述固定周期;Acquiring first historical monitoring data including the monitoring value at the current moment from the monitoring database; the duration of the first historical monitoring data is the fixed period;
采用滑窗方式从所述监控数据库中获取时长为所述固定周期的各个第二历史监控数据;Acquiring each second historical monitoring data whose duration is the fixed period from the monitoring database in a sliding window manner;
计算所述第一历史监控数据与每个第二历史数据的相似度,并将相似度大于相似度阈值的第二历史监控数据作为所述预测模型。The similarity between the first historical monitoring data and each second historical data is calculated, and the second historical monitoring data whose similarity is greater than a similarity threshold is used as the prediction model.
从上述内容可以看出:本发明的上述实施例中,接收监控请求,所述监控请求中携带有待监控主机的标识,根据所述待监控主机的标识,获取所述待监控主机的资源配置信息,并确定与所述待监控主机的资源配置信息匹配的监控插件,使用所述监控插件监控所述待监控主机,得到所述待监控主机在当前时刻的监控值。本发明实施例中,通过设置各种资源配置信息对应的监控插件,使得该方案能够适用于具有不同资源配置信息的监控场合,而不用限定在固定的监控场合,从而可以提高主机监控的灵活性;且,通过使用待监控主机的资源配置信息匹配的监控插件监控待监控主机,还可以使得对待监控主机的监控更有针对性,从而提高主机监控的准确性。It can be seen from the foregoing that: in the above-mentioned embodiment of the present invention, a monitoring request is received, and the monitoring request carries the identification of the host to be monitored, and the resource configuration information of the host to be monitored is obtained according to the identification of the host to be monitored. , And determine the monitoring plug-in matching the resource configuration information of the host to be monitored, use the monitoring plug-in to monitor the host to be monitored, and obtain the monitoring value of the host to be monitored at the current moment. In the embodiment of the present invention, by setting monitoring plug-ins corresponding to various resource configuration information, the solution can be applied to monitoring occasions with different resource configuration information, instead of being limited to fixed monitoring occasions, thereby improving the flexibility of host monitoring. ; Moreover, monitoring the host to be monitored by using a monitoring plug-in matching the resource configuration information of the host to be monitored can also make the monitoring of the host to be monitored more targeted, thereby improving the accuracy of host monitoring.
基于同一发明构思,本发明实施例还提供了一种计算设备,如图5所示,包括至少一个处理器501,以及与至少一个处理器连接的存储器502,本发明实施例中不限定处理器501与存储器502之间的具体连接介质,图5中处理器501和存储器502之间通过总线连接为例。总线可以分为地址总线、数据总线、控制总线等。Based on the same inventive concept, an embodiment of the present invention also provides a computing device. As shown in FIG. 5, it includes at least one processor 501 and a memory 502 connected to the at least one processor. The embodiment of the present invention does not limit the processor. For the specific connection medium between the 501 and the memory 502, the connection between the processor 501 and the memory 502 in FIG. 5 is taken as an example. The bus can be divided into address bus, data bus, control bus and so on.
在本发明实施例中,存储器502存储有可被至少一个处理器501执行的指令,至少一个处理器501通过执行存储器502存储的指令,可以执行前述的监控方法中所包括的步骤。In the embodiment of the present invention, the memory 502 stores instructions that can be executed by at least one processor 501, and the at least one processor 501 can execute the steps included in the foregoing monitoring method by executing the instructions stored in the memory 502.
其中,处理器501是计算设备的控制中心,可以利用各种接口和线路连接计算设备的各个部分,通过运行或执行存储在存储器502内的指令以及调用存储在存储器502内的数据,从而实现数据处理。可选的,处理器501可包括一个或多个处理单元,处理器501可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理下发指令。可以理解的是,上述调制解调处理器也可以不集成到处理器501中。在一些实施例中,处理器501和存储器502可以在同一芯片上实现,在一些实施例中,它们也可以在独立的芯片上分别实现。Among them, the processor 501 is the control center of the computing device. It can use various interfaces and lines to connect various parts of the computing device. deal with. Optionally, the processor 501 may include one or more processing units, and the processor 501 may integrate an application processor and a modem processor. The application processor mainly processes an operating system, a user interface, and an application program. The adjustment processor mainly handles issuing instructions. It can be understood that the foregoing modem processor may not be integrated into the processor 501. In some embodiments, the processor 501 and the memory 502 may be implemented on the same chip, and in some embodiments, they may also be implemented on separate chips.
处理器501可以是通用处理器,例如中央处理器(CPU)、数字信号处理器、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列或者其他可编程逻 辑器件、分立门或者晶体管逻辑器件、分立硬件组件,可以实现或者执行本发明实施例中公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者任何常规的处理器等。结合监控实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。The processor 501 may be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application specific integrated circuit (ASIC), a field programmable gate array or other programmable logic devices, discrete gates or transistors Logic devices and discrete hardware components can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed in combination with the monitoring embodiment can be directly embodied as executed and completed by a hardware processor, or executed and completed by a combination of hardware and software modules in the processor.
存储器502作为一种非易失性计算机可读存储介质,可用于存储非易失性软件程序、非易失性计算机可执行程序以及模块。存储器502可以包括至少一种类型的存储介质,例如可以包括闪存、硬盘、多媒体卡、卡型存储器、随机访问存储器(Random Access Memory,RAM)、静态随机访问存储器(Static Random Access Memory,SRAM)、可编程只读存储器(Programmable Read Only Memory,PROM)、只读存储器(Read Only Memory,ROM)、带电可擦除可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,EEPROM)、磁性存储器、磁盘、光盘等等。存储器502是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。本发明实施例中的存储器502还可以是电路或者其它任意能够实现存储功能的装置,用于存储程序指令和/或数据。The memory 502, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The memory 502 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (Random Access Memory, RAM), static random access memory (Static Random Access Memory, SRAM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), magnetic memory, disk , CD, etc. The memory 502 is any other medium that can be used to carry or store desired program codes in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto. The memory 502 in the embodiment of the present invention may also be a circuit or any other device capable of realizing a storage function for storing program instructions and/or data.
基于同一发明构思,本发明实施例还提供了一种计算机可读存储介质,其存储有可由计算设备执行的计算机程序,当所述程序在所述计算设备上运行时,使得所述计算设备执行上述监控方法的步骤。Based on the same inventive concept, embodiments of the present invention also provide a computer-readable storage medium that stores a computer program executable by a computing device, and when the program runs on the computing device, the computing device executes The steps of the above monitoring method.
基于相同的发明构思,本发明实施例提供了一种计算机程序产品,所述计算机程序产品包括存储在计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行上述监控方法的步骤。Based on the same inventive concept, the embodiments of the present invention provide a computer program product. The computer program product includes a computer program stored on a computer-readable storage medium. The computer program includes program instructions. When executed by a computer, the computer is made to execute the steps of the above-mentioned monitoring method.
本领域内的技术人员应明白,本发明的实施例可提供为方法、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present invention can be provided as a method or a computer program product. Therefore, the present invention may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to flowcharts and/or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and/or block in the flowchart and/or block diagram, and the combination of processes and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing equipment to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing equipment are used to generate It is a device that realizes the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device. The device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment. The instructions provide steps for implementing the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。Although the preferred embodiments of the present invention have been described, those skilled in the art can make additional changes and modifications to these embodiments once they learn the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present invention.
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. In this way, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention is also intended to include these modifications and variations.

Claims (15)

  1. 一种监控方法,其特征在于,所述方法包括:A monitoring method, characterized in that the method includes:
    接收监控请求,所述监控请求中携带有待监控主机的标识;Receiving a monitoring request, where the monitoring request carries an identifier of the host to be monitored;
    根据所述待监控主机的标识,获取所述待监控主机的资源配置信息;Acquiring the resource configuration information of the host to be monitored according to the identifier of the host to be monitored;
    确定与所述待监控主机的资源配置信息匹配的监控插件;Determining a monitoring plug-in matching the resource configuration information of the host to be monitored;
    使用所述监控插件监控所述待监控主机,得到所述待监控主机在当前时刻的监控值。Use the monitoring plug-in to monitor the host to be monitored, and obtain the monitoring value of the host to be monitored at the current moment.
  2. 根据权利要求1所述的方法,其特征在于,通过如下方式生成任一监控插件:The method according to claim 1, wherein any monitoring plug-in is generated in the following manner:
    接收插件配置请求,所述插件配置请求中包括所述监控插件对应的资源配置信息和监控值的输出规则;Receiving a plug-in configuration request, where the plug-in configuration request includes resource configuration information and monitoring value output rules corresponding to the monitoring plug-in;
    获取所述监控插件的初始脚本文件;Obtaining the initial script file of the monitoring plug-in;
    按照所述监控值的输出规则对所述初始脚本文件进行修正,得到所述监控插件的脚本文件;所述监控插件的脚本文件在运行时输出的监控值满足所述监控值的输出规则;Correcting the initial script file according to the output rule of the monitoring value to obtain the script file of the monitoring plug-in; the monitoring value output by the script file of the monitoring plug-in during operation meets the output rule of the monitoring value;
    根据所述监控插件的脚本文件和所述监控插件对应的资源配置信息,生成所述监控插件。The monitoring plug-in is generated according to the script file of the monitoring plug-in and the resource configuration information corresponding to the monitoring plug-in.
  3. 根据权利要求2所述的方法,其特征在于,所述获取所述监控插件的初始脚本文件,包括:The method according to claim 2, wherein said obtaining the initial script file of the monitoring plug-in comprises:
    接收客户端发送的所述监控插件的初始脚本文件,或者,从已有的监控插件中获取所述监控插件的初始脚本文件,或者,通过与第三方设备交互获取所述监控插件的初始脚本文件。Receive the initial script file of the monitoring plug-in sent by the client, or obtain the initial script file of the monitoring plug-in from an existing monitoring plug-in, or obtain the initial script file of the monitoring plug-in through interaction with a third-party device .
  4. 根据权利要求1至3中任一项所述的方法,其特征在于,所述得到所述待监控主机在当前时刻的监控值之后,还包括:The method according to any one of claims 1 to 3, wherein after obtaining the monitoring value of the host to be monitored at the current moment, the method further comprises:
    确定所述监控值对应的监控对象;Determine the monitoring object corresponding to the monitoring value;
    从监控数据库中获取所述待监控主机在所述监控对象下的历史监控值;Acquiring, from a monitoring database, the historical monitoring value of the host to be monitored under the monitoring object;
    使用所述监控对象对应的拟合算法对所述监控值和所述历史监控值进行拟合,得到所述待监控主机在所述监控对象下的预测模型;所述监控对象对应的拟合算法通过分析所述监控对象在历史时段的历史监控值的变化规律得到,所述预测模型用于预测未来时段内所述待监控主机在所述监控对象下的值。Use the fitting algorithm corresponding to the monitoring object to fit the monitoring value and the historical monitoring value to obtain the prediction model of the host to be monitored under the monitoring object; the fitting algorithm corresponding to the monitoring object It is obtained by analyzing the change rule of the historical monitoring value of the monitoring object in the historical period, and the prediction model is used to predict the value of the host to be monitored under the monitoring object in the future period.
  5. 根据权利要求4所述的方法,其特征在于,所述监控对象对应的拟合算法为线性回归算法;The method according to claim 4, wherein the fitting algorithm corresponding to the monitored object is a linear regression algorithm;
    所述使用所述监控对象对应的拟合算法对所述监控值和所述历史监控值进行拟合,得到所述待监控主机在所述监控对象下的预测模型,包括:The fitting the monitoring value and the historical monitoring value using the fitting algorithm corresponding to the monitoring object to obtain the prediction model of the host to be monitored under the monitoring object includes:
    从所述监控数据库中获取多个时刻的历史监控值;所述多个时刻临近所述当前时刻;Acquiring historical monitoring values of multiple moments from the monitoring database; the multiple moments are close to the current moment;
    设置初始预测模型,所述初始预测模型中包括多个未知参数;Setting an initial prediction model, the initial prediction model including a plurality of unknown parameters;
    将所述多个时刻的历史监控值和所述当前时刻的监控值代入所述初始预测模型,以确定出所述初始预测模型中的多个未知参数的值;Substituting the historical monitoring values of the multiple moments and the monitoring values of the current moment into the initial prediction model to determine the values of multiple unknown parameters in the initial prediction model;
    根据所述初始预测模型中的多个未知参数的值,构建所述预测模型。The prediction model is constructed according to the values of multiple unknown parameters in the initial prediction model.
  6. 根据权利要求4所述的方法,其特征在于,所述监控对象对应的拟合算法为固定周期匹配算法;The method according to claim 4, wherein the fitting algorithm corresponding to the monitored object is a fixed period matching algorithm;
    所述使用所述监控对象对应的拟合算法对所述监控值和所述历史监控值进行拟合,得 到所述待监控主机在所述监控对象下的预测模型,包括:The fitting the monitoring value and the historical monitoring value using the fitting algorithm corresponding to the monitoring object to obtain the prediction model of the host to be monitored under the monitoring object includes:
    确定所述监控对象对应的固定周期;Determine the fixed period corresponding to the monitored object;
    从所述监控数据库中获取包含当前时刻的监控值在内的第一历史监控数据;所述第一历史监控数据的时长为所述固定周期;Acquiring first historical monitoring data including the monitoring value at the current moment from the monitoring database; the duration of the first historical monitoring data is the fixed period;
    采用滑窗方式从所述监控数据库中获取时长为所述固定周期的各个第二历史监控数据;Acquiring each second historical monitoring data whose duration is the fixed period from the monitoring database in a sliding window manner;
    计算所述第一历史监控数据与每个第二历史数据的相似度,并将相似度大于相似度阈值的第二历史监控数据作为所述预测模型。The similarity between the first historical monitoring data and each second historical data is calculated, and the second historical monitoring data whose similarity is greater than a similarity threshold is used as the prediction model.
  7. 一种监控装置,其特征在于,所述装置包括:A monitoring device, characterized in that the device comprises:
    收发模块,用于接收监控请求,所述监控请求中携带有待监控主机的标识;The transceiver module is configured to receive a monitoring request, and the monitoring request carries an identifier of the host to be monitored;
    获取模块,用于根据所述待监控主机的标识,获取所述待监控主机的资源配置信息;An obtaining module, configured to obtain resource configuration information of the host to be monitored according to the identifier of the host to be monitored;
    确定模块,用于确定与所述待监控主机的资源配置信息匹配的监控插件;The determining module is used to determine the monitoring plug-in matching the resource configuration information of the host to be monitored;
    监控模块,用于使用所述监控插件监控所述待监控主机,得到所述待监控主机在当前时刻的监控值。The monitoring module is used to monitor the host to be monitored by using the monitoring plug-in to obtain the monitoring value of the host to be monitored at the current moment.
  8. 根据权利要求7所述的装置,其特征在于,所述收发模块还用于:接收插件配置请求,所述插件配置请求中包括所述监控插件对应的资源配置信息和监控值的输出规则;7. The device according to claim 7, wherein the transceiver module is further configured to: receive a plug-in configuration request, the plug-in configuration request including resource configuration information corresponding to the monitoring plug-in and output rules for monitoring values;
    所述获取模块还用于:获取所述监控插件的初始脚本文件;The obtaining module is also used to: obtain the initial script file of the monitoring plug-in;
    所述监控模块还用于:按照所述监控值的输出规则对所述初始脚本文件进行修正,得到所述监控插件的脚本文件,根据所述监控插件的脚本文件和所述监控插件对应的资源配置信息,生成所述监控插件;所述监控插件的脚本文件在运行时输出的监控值满足所述监控值的输出规则。The monitoring module is further configured to: modify the initial script file according to the output rule of the monitoring value to obtain the script file of the monitoring plug-in, according to the script file of the monitoring plug-in and the resource corresponding to the monitoring plug-in The configuration information is configured to generate the monitoring plug-in; the monitoring value output by the script file of the monitoring plug-in at runtime meets the output rule of the monitoring value.
  9. 根据权利要求8所述的装置,其特征在于,所述获取模块具体用于:The device according to claim 8, wherein the acquiring module is specifically configured to:
    接收客户端发送的所述监控插件的初始脚本文件,或者,从已有的监控插件中获取所述监控插件的初始脚本文件,或者,通过与第三方设备交互获取所述监控插件的初始脚本文件。Receive the initial script file of the monitoring plug-in sent by the client, or obtain the initial script file of the monitoring plug-in from an existing monitoring plug-in, or obtain the initial script file of the monitoring plug-in through interaction with a third-party device .
  10. 根据权利要求7至9中任一项所述的装置,其特征在于,所述监控模块得到所述待监控主机在当前时刻的监控值之后,还用于:The device according to any one of claims 7 to 9, wherein after the monitoring module obtains the monitoring value of the host to be monitored at the current moment, it is further configured to:
    确定所述监控值对应的监控对象;Determine the monitoring object corresponding to the monitoring value;
    从监控数据库中获取所述待监控主机在所述监控对象下的历史监控值;Acquiring, from a monitoring database, the historical monitoring value of the host to be monitored under the monitoring object;
    使用所述监控对象对应的拟合算法对所述监控值和所述历史监控值进行拟合,得到所述待监控主机在所述监控对象下的预测模型;所述监控对象对应的拟合算法通过分析所述监控对象在历史时段的历史监控值的变化规律得到,所述预测模型用于预测未来时段内所述待监控主机在所述监控对象下的值。Use the fitting algorithm corresponding to the monitoring object to fit the monitoring value and the historical monitoring value to obtain the prediction model of the host to be monitored under the monitoring object; the fitting algorithm corresponding to the monitoring object It is obtained by analyzing the change rule of the historical monitoring value of the monitoring object in the historical period, and the prediction model is used to predict the value of the host to be monitored under the monitoring object in the future period.
  11. 根据权利要求10所述的装置,其特征在于,所述监控对象对应的拟合算法为线性回归算法;The device according to claim 10, wherein the fitting algorithm corresponding to the monitored object is a linear regression algorithm;
    所述监控模块具体用于:The monitoring module is specifically used for:
    从所述监控数据库中获取多个时刻的历史监控值;所述多个时刻临近所述当前时刻;Acquiring historical monitoring values of multiple moments from the monitoring database; the multiple moments are close to the current moment;
    设置初始预测模型,所述初始预测模型中包括多个未知参数;Setting an initial prediction model, the initial prediction model including a plurality of unknown parameters;
    将所述多个时刻的历史监控值和所述当前时刻的监控值代入所述初始预测模型,以确定出所述初始预测模型中的多个未知参数的值;Substituting the historical monitoring values of the multiple moments and the monitoring values of the current moment into the initial prediction model to determine the values of multiple unknown parameters in the initial prediction model;
    根据所述初始预测模型中的多个未知参数的值,构建所述预测模型。The prediction model is constructed according to the values of multiple unknown parameters in the initial prediction model.
  12. 根据权利要求10所述的装置,其特征在于,所述监控对象对应的拟合算法为固定周期匹配算法;The device according to claim 10, wherein the fitting algorithm corresponding to the monitored object is a fixed period matching algorithm;
    所述监控模块具体用于:The monitoring module is specifically used for:
    确定所述监控对象对应的固定周期;Determine the fixed period corresponding to the monitored object;
    从所述监控数据库中获取包含当前时刻的监控值在内的第一历史监控数据;所述第一历史监控数据的时长为所述固定周期;Acquiring first historical monitoring data including the monitoring value at the current moment from the monitoring database; the duration of the first historical monitoring data is the fixed period;
    采用滑窗方式从所述监控数据库中获取时长为所述固定周期的各个第二历史监控数据;Acquiring each second historical monitoring data whose duration is the fixed period from the monitoring database in a sliding window manner;
    计算所述第一历史监控数据与每个第二历史数据的相似度,并将相似度大于相似度阈值的第二历史监控数据作为所述预测模型。The similarity between the first historical monitoring data and each second historical data is calculated, and the second historical monitoring data whose similarity is greater than a similarity threshold is used as the prediction model.
  13. 一种计算设备,其特征在于,包括至少一个处理器以及至少一个存储器,其中,所述存储器存储有计算机程序,当所述程序被所述处理器执行时,使得所述处理器执行权利要求1~6任一权利要求所述的方法。A computing device, comprising at least one processor and at least one memory, wherein the memory stores a computer program, and when the program is executed by the processor, the processor executes claim 1 ~6 The method of any one of claims.
  14. 一种计算机可读存储介质,其特征在于,其存储有可由计算设备执行的计算机程序,当所述程序在所述计算设备上运行时,使得所述计算设备执行权利要求1~6任一权利要求所述的方法。A computer-readable storage medium, characterized in that it stores a computer program executable by a computing device, and when the program runs on the computing device, the computing device executes any one of claims 1 to 6 Require the described method.
  15. 一种计算机程序产品,其特征在于,所述计算机程序产品包括存储在计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,使所述计算机执行权利要求1-6任一项所述的方法的步骤。A computer program product, characterized in that the computer program product includes a computer program stored on a computer-readable storage medium, the computer program includes program instructions, and when the program instructions are executed by a computer, the computer Perform the steps of the method of any one of claims 1-6.
PCT/CN2020/130169 2019-12-20 2020-11-19 Monitoring method and apparatus WO2021120975A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911331007.0A CN111143165A (en) 2019-12-20 2019-12-20 Monitoring method and device
CN201911331007.0 2019-12-20

Publications (1)

Publication Number Publication Date
WO2021120975A1 true WO2021120975A1 (en) 2021-06-24

Family

ID=70519284

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/130169 WO2021120975A1 (en) 2019-12-20 2020-11-19 Monitoring method and apparatus

Country Status (2)

Country Link
CN (1) CN111143165A (en)
WO (1) WO2021120975A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111143165A (en) * 2019-12-20 2020-05-12 深圳前海微众银行股份有限公司 Monitoring method and device
CN111461581A (en) * 2020-05-17 2020-07-28 商志营 Intelligent early warning management system and implementation method
CN112764995B (en) * 2021-01-26 2023-04-07 山东云海国创云计算装备产业创新中心有限公司 Server hardware resource monitoring method, device and medium
CN112817937A (en) * 2021-01-27 2021-05-18 上海臣星软件技术有限公司 Big data monitoring method and device, electronic equipment and computer storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101272481A (en) * 2008-04-02 2008-09-24 武汉大学 Video monitoring front end equipment access method
US20120246303A1 (en) * 2011-03-23 2012-09-27 LogRhythm Inc. Log collection, structuring and processing
US20140337508A1 (en) * 2013-05-09 2014-11-13 Telefonaktiebolaget L M Ericsson (Publ) Method and Apparatus for Providing Network Applications Monitoring
CN105760272A (en) * 2016-01-29 2016-07-13 山东鲁能智能技术有限公司 Monitoring background service customization method based on plug-in and system based on method
CN107483245A (en) * 2017-08-14 2017-12-15 上海新炬网络信息技术股份有限公司 It is a kind of that realization device is actively gathered based on karaf_agent
CN108920324A (en) * 2018-06-08 2018-11-30 广东轩辕网络科技股份有限公司 The method of the trend analysis of information technoloy equipment memory capacity and early warning, system and electronic device
CN111143165A (en) * 2019-12-20 2020-05-12 深圳前海微众银行股份有限公司 Monitoring method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101272481A (en) * 2008-04-02 2008-09-24 武汉大学 Video monitoring front end equipment access method
US20120246303A1 (en) * 2011-03-23 2012-09-27 LogRhythm Inc. Log collection, structuring and processing
US20140337508A1 (en) * 2013-05-09 2014-11-13 Telefonaktiebolaget L M Ericsson (Publ) Method and Apparatus for Providing Network Applications Monitoring
CN105760272A (en) * 2016-01-29 2016-07-13 山东鲁能智能技术有限公司 Monitoring background service customization method based on plug-in and system based on method
CN107483245A (en) * 2017-08-14 2017-12-15 上海新炬网络信息技术股份有限公司 It is a kind of that realization device is actively gathered based on karaf_agent
CN108920324A (en) * 2018-06-08 2018-11-30 广东轩辕网络科技股份有限公司 The method of the trend analysis of information technoloy equipment memory capacity and early warning, system and electronic device
CN111143165A (en) * 2019-12-20 2020-05-12 深圳前海微众银行股份有限公司 Monitoring method and device

Also Published As

Publication number Publication date
CN111143165A (en) 2020-05-12

Similar Documents

Publication Publication Date Title
WO2021120975A1 (en) Monitoring method and apparatus
US11403413B2 (en) Avoiding user session misclassification using configuration and activity fingerprints
US9882912B2 (en) System and method for providing authentication service for internet of things security
US8806620B2 (en) Method and device for managing security events
US20170142089A1 (en) Reducing authentication confidence over time based on user history
CN109800160B (en) Cluster server fault testing method and related device in machine learning system
CN111641563B (en) Flow self-adaption method and system based on distributed scene
CN111614761B (en) Block chain message transmission method, device, computer and readable storage medium
CN109766694B (en) Program protocol white list linkage method and device of industrial control host
CN105100032A (en) Method and apparatus for preventing resource steal
CN110222535B (en) Processing device, method and storage medium for block chain configuration file
CN111698303A (en) Data processing method and device, electronic equipment and storage medium
TW201441934A (en) Method and device for updating client
CN109145651B (en) Data processing method and device
CN108234441B (en) Method, apparatus, electronic device and storage medium for determining forged access request
US10621337B1 (en) Application-to-application device ID sharing
US20230198771A1 (en) Systems and methods for providing secure internet of things data notifications using blockchain
CN103559438A (en) Progress identification method and progress identification system
CN113238923B (en) Service behavior tracing method and system based on state machine
US11251976B2 (en) Data security processing method and terminal thereof, and server
CN113259429B (en) Session maintenance management and control method, device, computer equipment and medium
CN107181801B (en) Electronic accessory storage method and terminal
CN111124591A (en) Mirror image transmission method and device, electronic equipment and storage medium
CN111159009A (en) Pressure testing method and device for log service system
CN114567678A (en) Resource calling method and device of cloud security service and electronic equipment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20902805

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 14.10.2022)

122 Ep: pct application non-entry in european phase

Ref document number: 20902805

Country of ref document: EP

Kind code of ref document: A1