[monitor] 支持TELNET监测服务端口可用性监控类型
This commit is contained in:
@@ -4,6 +4,7 @@ import com.usthe.common.entity.job.protocol.HttpProtocol;
|
||||
import com.usthe.common.entity.job.protocol.IcmpProtocol;
|
||||
import com.usthe.common.entity.job.protocol.JdbcProtocol;
|
||||
import com.usthe.common.entity.job.protocol.TcpUdpProtocol;
|
||||
import com.usthe.common.entity.job.protocol.TelnetProtocol;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
@@ -60,6 +61,10 @@ public class Metrics {
|
||||
* 使用icmp协议进行ping的监控配置信息
|
||||
*/
|
||||
private IcmpProtocol icmp;
|
||||
/**
|
||||
* 使用telnet协议的监控配置信息
|
||||
*/
|
||||
private TelnetProtocol telnet;
|
||||
/**
|
||||
* 使用socket实现的tcp或ucp进行服务端口探测配置信息
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.usthe.common.entity.job.protocol;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* telnet协议配置
|
||||
* @author tomsun28
|
||||
* @date 2021/10/31 16:41
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class TelnetProtocol {
|
||||
|
||||
/**
|
||||
* 对端主机ip或域名
|
||||
*/
|
||||
private String host;
|
||||
|
||||
/**
|
||||
* 对端主机端口
|
||||
*/
|
||||
private String port;
|
||||
|
||||
/**
|
||||
* 超时时间
|
||||
*/
|
||||
private String timeout;
|
||||
|
||||
}
|
||||
21
manager/src/main/resources/define/app/telnet.yml
Normal file
21
manager/src/main/resources/define/app/telnet.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
app: telnet
|
||||
configmap:
|
||||
- key: host
|
||||
type: 1
|
||||
- key: port
|
||||
type: 0
|
||||
- key: timeout
|
||||
type: 0
|
||||
metrics:
|
||||
- name: summary
|
||||
priority: 0
|
||||
fields:
|
||||
- field: responseTime
|
||||
type: 0
|
||||
unit: ms
|
||||
protocol: telnet
|
||||
# 当protocol为telnet协议时具体的采集配置
|
||||
telnet:
|
||||
host: ^_^host^_^
|
||||
port: ^_^port^_^
|
||||
timeout: ^_^timeout^_^
|
||||
27
manager/src/main/resources/define/param/telnet.yml
Normal file
27
manager/src/main/resources/define/param/telnet.yml
Normal file
@@ -0,0 +1,27 @@
|
||||
# 监控应用类型名称(与文件名保持一致) eg: linux windows tomcat mysql aws...
|
||||
app: telnet
|
||||
# 强制固定必须参数 - host(ipv4,ipv6,域名)
|
||||
param:
|
||||
# field-字段名称标识符
|
||||
- field: host
|
||||
# name-参数字段显示名称
|
||||
name: 主机Host
|
||||
# type-字段类型,样式(大部分映射input标签type属性)
|
||||
type: host
|
||||
# 是否是必输项 true-必填 false-可选
|
||||
required: true
|
||||
- field: port
|
||||
name: 端口
|
||||
type: number
|
||||
# 当type为number时,用range表示范围
|
||||
range: '[0,65535]'
|
||||
required: true
|
||||
defaultValue: 80
|
||||
- field: timeout
|
||||
name: Telnet超时时间
|
||||
type: number
|
||||
# 当type为number时,用range表示范围
|
||||
range: '[0,100000]'
|
||||
required: true
|
||||
placeholder: '请输入超时时间,单位毫秒'
|
||||
defaultValue: 3000
|
||||
Reference in New Issue
Block a user