Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
hertzbeat
Hertzbeat
提交
fd2f058a
Hertzbeat
项目概览
hertzbeat
/
Hertzbeat
9 个月 前同步成功
通知
1
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Hertzbeat
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
fd2f058a
编写于
7月 28, 2023
作者:
sinat_25235033
提交者:
GitHub
7月 28, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
support ssh protocol config choose if reuse connection (#1136)
上级
ac08d041
变更
22
隐藏空白更改
内联
并排
Showing
22 changed file
with
369 addition
and
60 deletion
+369
-60
collector/src/main/java/org/dromara/hertzbeat/collector/collect/common/cache/CommonCache.java
...hertzbeat/collector/collect/common/cache/CommonCache.java
+1
-0
collector/src/main/java/org/dromara/hertzbeat/collector/collect/common/ssh/CommonSshClient.java
...rtzbeat/collector/collect/common/ssh/CommonSshClient.java
+10
-8
collector/src/main/java/org/dromara/hertzbeat/collector/collect/mongodb/MongodbSingleCollectImpl.java
...t/collector/collect/mongodb/MongodbSingleCollectImpl.java
+10
-16
collector/src/main/java/org/dromara/hertzbeat/collector/collect/ssh/SshCollectImpl.java
...omara/hertzbeat/collector/collect/ssh/SshCollectImpl.java
+53
-28
collector/src/main/java/org/dromara/hertzbeat/collector/collect/strategy/CollectStrategyFactory.java
...at/collector/collect/strategy/CollectStrategyFactory.java
+3
-0
common/src/main/java/org/dromara/hertzbeat/common/entity/job/protocol/SshProtocol.java
...ara/hertzbeat/common/entity/job/protocol/SshProtocol.java
+5
-0
manager/src/main/java/org/dromara/hertzbeat/manager/service/JobSchedulerInit.java
...g/dromara/hertzbeat/manager/service/JobSchedulerInit.java
+12
-2
manager/src/main/java/org/dromara/hertzbeat/manager/service/impl/MonitorServiceImpl.java
...ra/hertzbeat/manager/service/impl/MonitorServiceImpl.java
+10
-0
manager/src/main/resources/define/app-almalinux.yml
manager/src/main/resources/define/app-almalinux.yml
+23
-0
manager/src/main/resources/define/app-centos.yml
manager/src/main/resources/define/app-centos.yml
+23
-0
manager/src/main/resources/define/app-coreos.yml
manager/src/main/resources/define/app-coreos.yml
+23
-0
manager/src/main/resources/define/app-debian.yml
manager/src/main/resources/define/app-debian.yml
+23
-0
manager/src/main/resources/define/app-euleros.yml
manager/src/main/resources/define/app-euleros.yml
+23
-0
manager/src/main/resources/define/app-freebsd.yml
manager/src/main/resources/define/app-freebsd.yml
+21
-0
manager/src/main/resources/define/app-linux.yml
manager/src/main/resources/define/app-linux.yml
+23
-0
manager/src/main/resources/define/app-opensuse.yml
manager/src/main/resources/define/app-opensuse.yml
+23
-0
manager/src/main/resources/define/app-oracle.yml
manager/src/main/resources/define/app-oracle.yml
+3
-3
manager/src/main/resources/define/app-redhat.yml
manager/src/main/resources/define/app-redhat.yml
+23
-0
manager/src/main/resources/define/app-rockylinux.yml
manager/src/main/resources/define/app-rockylinux.yml
+23
-0
manager/src/main/resources/define/app-ubuntu.yml
manager/src/main/resources/define/app-ubuntu.yml
+23
-0
manager/src/test/java/org/dromara/hertzbeat/manager/service/MonitorServiceTest.java
...dromara/hertzbeat/manager/service/MonitorServiceTest.java
+1
-0
web-app/src/app/routes/monitor/monitor-edit/monitor-edit.component.ts
...app/routes/monitor/monitor-edit/monitor-edit.component.ts
+10
-3
未找到文件。
collector/src/main/java/org/dromara/hertzbeat/collector/collect/common/cache/CommonCache.java
浏览文件 @
fd2f058a
...
...
@@ -159,6 +159,7 @@ public class CommonCache {
* @param timeDiff 缓存对象保存时间 millis
*/
public
void
addCache
(
Object
key
,
Object
value
,
Long
timeDiff
)
{
removeCache
(
key
);
if
(
timeDiff
==
null
)
{
timeDiff
=
DEFAULT_CACHE_TIMEOUT
;
}
...
...
collector/src/main/java/org/dromara/hertzbeat/collector/collect/common/ssh/CommonSshClient.java
浏览文件 @
fd2f058a
...
...
@@ -14,23 +14,25 @@ import org.apache.sshd.core.CoreModuleProperties;
@Slf4j
public
class
CommonSshClient
{
private
static
SshClient
sshClient
;
private
static
final
SshClient
SSH_CLIENT
;
static
{
sshClient
=
SshClient
.
setUpDefaultClient
();
SSH_CLIENT
=
SshClient
.
setUpDefaultClient
();
// 接受所有服务端公钥校验,会打印warn日志 Server at {} presented unverified {} key: {}
AcceptAllServerKeyVerifier
verifier
=
AcceptAllServerKeyVerifier
.
INSTANCE
;
sshClient
.
setServerKeyVerifier
(
verifier
);
// 设置链接保活心跳2000毫秒一次, 客户端等待保活心跳响应超时时间300_000
0
毫秒
SSH_CLIENT
.
setServerKeyVerifier
(
verifier
);
// 设置链接保活心跳2000毫秒一次, 客户端等待保活心跳响应超时时间300_000毫秒
PropertyResolverUtils
.
updateProperty
(
sshClient
,
CoreModuleProperties
.
HEARTBEAT_INTERVAL
.
getName
(),
2000
);
SSH_CLIENT
,
CoreModuleProperties
.
HEARTBEAT_INTERVAL
.
getName
(),
2000
);
PropertyResolverUtils
.
updateProperty
(
sshClient
,
CoreModuleProperties
.
HEARTBEAT_REPLY_WAIT
.
getName
(),
300_000
);
sshClient
.
start
();
SSH_CLIENT
,
CoreModuleProperties
.
HEARTBEAT_REPLY_WAIT
.
getName
(),
300_000
);
PropertyResolverUtils
.
updateProperty
(
SSH_CLIENT
,
CoreModuleProperties
.
SOCKET_KEEPALIVE
.
getName
(),
true
);
SSH_CLIENT
.
start
();
}
public
static
SshClient
getSshClient
()
{
return
sshClient
;
return
SSH_CLIENT
;
}
}
collector/src/main/java/org/dromara/hertzbeat/collector/collect/mongodb/MongodbSingleCollectImpl.java
浏览文件 @
fd2f058a
...
...
@@ -17,8 +17,8 @@
package
org.dromara.hertzbeat.collector.collect.mongodb
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLEncoder
;
import
java.nio.charset.StandardCharsets
;
import
java.util.Arrays
;
import
java.util.Optional
;
...
...
@@ -47,20 +47,18 @@ import lombok.extern.slf4j.Slf4j;
* Mongodb 单机指标收集器
*
* @author <a href="mailto:liudonghua123@gmail.com">liudonghua</a>
* @version 1.0
* Created by liudonghua on 2023/01/01
* see also https://www.mongodb.com/languages/java,
* https://www.mongodb.com/docs/manual/reference/command/serverStatus/#metrics
* see also https://www.mongodb.com/languages/java,
* https://www.mongodb.com/docs/manual/reference/command/serverStatus/#metrics
*/
@Slf4j
public
class
MongodbSingleCollectImpl
extends
AbstractCollect
{
/**
* 支持的 mongodb diagnostic 命令,排除internal/deprecated相关的命令
* 可参考
https://www.mongodb.com/docs/manual/reference/command/nav-diagnostic/
,
*
https://www.mongodb.com/docs/mongodb-shell/run-commands/
* 可参考
<a href="https://www.mongodb.com/docs/manual/reference/command/nav-diagnostic/">...</a>
,
*
<a href="https://www.mongodb.com/docs/mongodb-shell/run-commands/">...</a>
* 注意:一些命令需要相应的权限才能执行,否则执行虽然不会报错,但是返回的结果是空的,
* 详见
https://www.mongodb.com/docs/manual/reference/built-in-roles/
* 详见
<a href="https://www.mongodb.com/docs/manual/reference/built-in-roles/">...</a>
*/
private
static
final
String
[]
SUPPORTED_MONGODB_DIAGNOSTIC_COMMANDS
=
{
"buildInfo"
,
...
...
@@ -199,14 +197,10 @@ public class MongodbSingleCollectImpl extends AbstractCollect {
}
// 复用失败则新建连接 connect to mongodb
String
url
;
try
{
// 密码可能包含特殊字符,需要使用类似js的encodeURIComponent进行编码,这里使用java的URLEncoder
url
=
String
.
format
(
"mongodb://%s:%s@%s:%s/%s?authSource=%s"
,
mongodbProtocol
.
getUsername
(),
URLEncoder
.
encode
(
mongodbProtocol
.
getPassword
(),
"UTF-8"
),
mongodbProtocol
.
getHost
(),
mongodbProtocol
.
getPort
(),
mongodbProtocol
.
getDatabase
(),
mongodbProtocol
.
getAuthenticationDatabase
());
}
catch
(
UnsupportedEncodingException
e
)
{
throw
new
RuntimeException
(
e
);
}
// 密码可能包含特殊字符,需要使用类似js的encodeURIComponent进行编码,这里使用java的URLEncoder
url
=
String
.
format
(
"mongodb://%s:%s@%s:%s/%s?authSource=%s"
,
mongodbProtocol
.
getUsername
(),
URLEncoder
.
encode
(
mongodbProtocol
.
getPassword
(),
StandardCharsets
.
UTF_8
),
mongodbProtocol
.
getHost
(),
mongodbProtocol
.
getPort
(),
mongodbProtocol
.
getDatabase
(),
mongodbProtocol
.
getAuthenticationDatabase
());
mongoClient
=
MongoClients
.
create
(
url
);
MongodbConnect
mongodbConnect
=
new
MongodbConnect
(
mongoClient
);
CommonCache
.
getInstance
().
addCache
(
identifier
,
mongodbConnect
);
...
...
collector/src/main/java/org/dromara/hertzbeat/collector/collect/ssh/SshCollectImpl.java
浏览文件 @
fd2f058a
...
...
@@ -17,6 +17,9 @@
package
org.dromara.hertzbeat.collector.collect.ssh
;
import
org.apache.sshd.common.SshException
;
import
org.apache.sshd.common.channel.exception.SshChannelOpenException
;
import
org.apache.sshd.common.util.io.output.NoCloseOutputStream
;
import
org.apache.sshd.common.util.security.SecurityUtils
;
import
org.dromara.hertzbeat.collector.collect.AbstractCollect
;
import
org.dromara.hertzbeat.collector.collect.common.cache.CacheIdentifier
;
...
...
@@ -43,9 +46,11 @@ import java.io.ByteArrayOutputStream;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.net.ConnectException
;
import
java.net.SocketTimeoutException
;
import
java.security.GeneralSecurityException
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collection
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -83,24 +88,24 @@ public class SshCollectImpl extends AbstractCollect {
return
;
}
SshProtocol
sshProtocol
=
metrics
.
getSsh
();
boolean
reuseConnection
=
Boolean
.
parseBoolean
(
sshProtocol
.
getReuseConnection
());
int
timeout
=
CollectUtil
.
getTimeout
(
sshProtocol
.
getTimeout
(),
DEFAULT_TIMEOUT
);
ClientChannel
channel
=
null
;
ClientSession
clientSession
=
null
;
try
{
ClientSession
clientSession
=
getConnectSession
(
sshProtocol
,
timeout
);
clientSession
=
getConnectSession
(
sshProtocol
,
timeout
,
reuseConnection
);
channel
=
clientSession
.
createExecChannel
(
sshProtocol
.
getScript
());
ByteArrayOutputStream
response
=
new
ByteArrayOutputStream
();
channel
.
setOut
(
response
);
if
(!
channel
.
open
().
verify
(
timeout
).
isOpened
())
{
removeConnectSessionCache
(
sshProtocol
);
channel
.
close
();
clientSession
.
close
();
throw
new
Exception
(
"ssh channel open failed"
);
}
channel
.
setErr
(
new
NoCloseOutputStream
(
System
.
err
));
channel
.
open
().
verify
(
timeout
);
List
<
ClientChannelEvent
>
list
=
new
ArrayList
<>();
list
.
add
(
ClientChannelEvent
.
CLOSED
);
channel
.
waitFor
(
list
,
timeout
);
Collection
<
ClientChannelEvent
>
waitEvents
=
channel
.
waitFor
(
list
,
timeout
);
if
(
waitEvents
.
contains
(
ClientChannelEvent
.
TIMEOUT
))
{
throw
new
SocketTimeoutException
(
"Failed to retrieve command result in time: "
+
sshProtocol
.
getScript
());
}
Long
responseTime
=
System
.
currentTimeMillis
()
-
startTime
;
channel
.
close
();
String
result
=
response
.
toString
();
if
(!
StringUtils
.
hasText
(
result
))
{
builder
.
setCode
(
CollectRep
.
Code
.
FAIL
);
...
...
@@ -126,11 +131,19 @@ public class SshCollectImpl extends AbstractCollect {
log
.
info
(
errorMsg
);
builder
.
setCode
(
CollectRep
.
Code
.
UN_CONNECTABLE
);
builder
.
setMsg
(
"The peer refused to connect: service port does not listening or firewall: "
+
errorMsg
);
}
catch
(
SshException
sshException
)
{
Throwable
throwable
=
sshException
.
getCause
();
if
(
throwable
instanceof
SshChannelOpenException
)
{
log
.
warn
(
"Remote ssh server no more session channel, please increase sshd_config MaxSessions."
);
}
String
errorMsg
=
CommonUtil
.
getMessageFromThrowable
(
sshException
);
builder
.
setCode
(
CollectRep
.
Code
.
UN_CONNECTABLE
);
builder
.
setMsg
(
"Peer ssh connection failed: "
+
errorMsg
);
}
catch
(
IOException
ioException
)
{
String
errorMsg
=
CommonUtil
.
getMessageFromThrowable
(
ioException
);
log
.
info
(
errorMsg
);
builder
.
setCode
(
CollectRep
.
Code
.
UN_CONNECTABLE
);
builder
.
setMsg
(
"Peer connection failed: "
+
errorMsg
);
builder
.
setMsg
(
"Peer
io
connection failed: "
+
errorMsg
);
}
catch
(
Exception
exception
)
{
String
errorMsg
=
CommonUtil
.
getMessageFromThrowable
(
exception
);
log
.
warn
(
errorMsg
,
exception
);
...
...
@@ -144,6 +157,13 @@ public class SshCollectImpl extends AbstractCollect {
log
.
error
(
e
.
getMessage
(),
e
);
}
}
if
(
clientSession
!=
null
&&
!
reuseConnection
)
{
try
{
clientSession
.
close
();
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
}
}
}
}
...
...
@@ -247,28 +267,31 @@ public class SshCollectImpl extends AbstractCollect {
CommonCache
.
getInstance
().
removeCache
(
identifier
);
}
private
ClientSession
getConnectSession
(
SshProtocol
sshProtocol
,
int
timeout
)
throws
IOException
,
GeneralSecurityException
{
private
ClientSession
getConnectSession
(
SshProtocol
sshProtocol
,
int
timeout
,
boolean
reuseConnection
)
throws
IOException
,
GeneralSecurityException
{
CacheIdentifier
identifier
=
CacheIdentifier
.
builder
()
.
ip
(
sshProtocol
.
getHost
()).
port
(
sshProtocol
.
getPort
())
.
username
(
sshProtocol
.
getUsername
()).
password
(
sshProtocol
.
getPassword
())
.
build
();
Optional
<
Object
>
cacheOption
=
CommonCache
.
getInstance
().
getCache
(
identifier
,
true
);
.
ip
(
sshProtocol
.
getHost
()).
port
(
sshProtocol
.
getPort
())
.
username
(
sshProtocol
.
getUsername
()).
password
(
sshProtocol
.
getPassword
())
.
build
();
ClientSession
clientSession
=
null
;
if
(
cacheOption
.
isPresent
())
{
clientSession
=
((
SshConnect
)
cacheOption
.
get
()).
getConnection
();
try
{
if
(
clientSession
==
null
||
clientSession
.
isClosed
()
||
clientSession
.
isClosing
())
{
if
(
reuseConnection
)
{
Optional
<
Object
>
cacheOption
=
CommonCache
.
getInstance
().
getCache
(
identifier
,
true
);
if
(
cacheOption
.
isPresent
())
{
clientSession
=
((
SshConnect
)
cacheOption
.
get
()).
getConnection
();
try
{
if
(
clientSession
==
null
||
clientSession
.
isClosed
()
||
clientSession
.
isClosing
())
{
clientSession
=
null
;
CommonCache
.
getInstance
().
removeCache
(
identifier
);
}
}
catch
(
Exception
e
)
{
log
.
warn
(
e
.
getMessage
());
clientSession
=
null
;
CommonCache
.
getInstance
().
removeCache
(
identifier
);
}
}
catch
(
Exception
e
)
{
log
.
warn
(
e
.
getMessage
());
clientSession
=
null
;
CommonCache
.
getInstance
().
removeCache
(
identifier
);
}
}
if
(
clientSession
!=
null
)
{
return
clientSession
;
if
(
clientSession
!=
null
)
{
return
clientSession
;
}
}
SshClient
sshClient
=
CommonSshClient
.
getSshClient
();
clientSession
=
sshClient
.
connect
(
sshProtocol
.
getUsername
(),
sshProtocol
.
getHost
(),
Integer
.
parseInt
(
sshProtocol
.
getPort
()))
...
...
@@ -286,8 +309,10 @@ public class SshCollectImpl extends AbstractCollect {
clientSession
.
close
();
throw
new
IllegalArgumentException
(
"ssh auth failed."
);
}
SshConnect
sshConnect
=
new
SshConnect
(
clientSession
);
CommonCache
.
getInstance
().
addCache
(
identifier
,
sshConnect
);
if
(
reuseConnection
)
{
SshConnect
sshConnect
=
new
SshConnect
(
clientSession
);
CommonCache
.
getInstance
().
addCache
(
identifier
,
sshConnect
);
}
return
clientSession
;
}
...
...
collector/src/main/java/org/dromara/hertzbeat/collector/collect/strategy/CollectStrategyFactory.java
浏览文件 @
fd2f058a
...
...
@@ -3,6 +3,8 @@ package org.dromara.hertzbeat.collector.collect.strategy;
import
org.dromara.hertzbeat.collector.collect.AbstractCollect
;
import
org.springframework.boot.CommandLineRunner
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.core.Ordered
;
import
org.springframework.core.annotation.Order
;
import
java.util.ServiceLoader
;
import
java.util.concurrent.ConcurrentHashMap
;
...
...
@@ -14,6 +16,7 @@ import java.util.concurrent.ConcurrentHashMap;
*
*/
@Configuration
@Order
(
value
=
Ordered
.
HIGHEST_PRECEDENCE
)
public
class
CollectStrategyFactory
implements
CommandLineRunner
{
/**
...
...
common/src/main/java/org/dromara/hertzbeat/common/entity/job/protocol/SshProtocol.java
浏览文件 @
fd2f058a
...
...
@@ -63,6 +63,11 @@ public class SshProtocol {
* 私钥(可选)
*/
private
String
privateKey
;
/**
* reuse connection session
*/
private
String
reuseConnection
=
"true"
;
/**
* SSH执行脚本
...
...
manager/src/main/java/org/dromara/hertzbeat/manager/service/JobSchedulerInit.java
浏览文件 @
fd2f058a
...
...
@@ -22,6 +22,7 @@ import org.dromara.hertzbeat.common.entity.job.Configmap;
import
org.dromara.hertzbeat.common.entity.job.Job
;
import
org.dromara.hertzbeat.common.entity.manager.Monitor
;
import
org.dromara.hertzbeat.common.entity.manager.Param
;
import
org.dromara.hertzbeat.common.entity.manager.ParamDefine
;
import
org.dromara.hertzbeat.common.util.JsonUtil
;
import
org.dromara.hertzbeat.manager.dao.MonitorDao
;
import
org.dromara.hertzbeat.manager.dao.ParamDao
;
...
...
@@ -30,6 +31,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.boot.CommandLineRunner
;
import
org.springframework.core.annotation.Order
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
java.util.Arrays
;
import
java.util.List
;
...
...
@@ -65,8 +67,6 @@ public class JobSchedulerInit implements CommandLineRunner {
try
{
// 构造采集任务Job实体
Job
appDefine
=
appService
.
getAppDefine
(
monitor
.
getApp
());
// todo 这里暂时是深拷贝处理
appDefine
=
JsonUtil
.
fromJson
(
JsonUtil
.
toJson
(
appDefine
),
Job
.
class
);
appDefine
.
setId
(
monitor
.
getJobId
());
appDefine
.
setMonitorId
(
monitor
.
getId
());
appDefine
.
setInterval
(
monitor
.
getIntervals
());
...
...
@@ -75,6 +75,16 @@ public class JobSchedulerInit implements CommandLineRunner {
List
<
Param
>
params
=
paramDao
.
findParamsByMonitorId
(
monitor
.
getId
());
List
<
Configmap
>
configmaps
=
params
.
stream
().
map
(
param
->
new
Configmap
(
param
.
getField
(),
param
.
getValue
(),
param
.
getType
())).
collect
(
Collectors
.
toList
());
List
<
ParamDefine
>
paramDefaultValue
=
appDefine
.
getParams
().
stream
()
.
filter
(
item
->
StringUtils
.
hasText
(
item
.
getDefaultValue
()))
.
collect
(
Collectors
.
toList
());
paramDefaultValue
.
forEach
(
defaultVar
->
{
if
(
configmaps
.
stream
().
noneMatch
(
item
->
item
.
getKey
().
equals
(
defaultVar
.
getField
())))
{
// todo type
Configmap
configmap
=
new
Configmap
(
defaultVar
.
getField
(),
defaultVar
.
getDefaultValue
(),
(
byte
)
1
);
configmaps
.
add
(
configmap
);
}
});
appDefine
.
setConfigmap
(
configmaps
);
// 下发采集任务
long
jobId
=
collectJobService
.
addAsyncCollectJob
(
appDefine
);
...
...
manager/src/main/java/org/dromara/hertzbeat/manager/service/impl/MonitorServiceImpl.java
浏览文件 @
fd2f058a
...
...
@@ -593,6 +593,16 @@ public class MonitorServiceImpl implements MonitorService {
List
<
Param
>
params
=
paramDao
.
findParamsByMonitorId
(
monitor
.
getId
());
List
<
Configmap
>
configmaps
=
params
.
stream
().
map
(
param
->
new
Configmap
(
param
.
getField
(),
param
.
getValue
(),
param
.
getType
())).
collect
(
Collectors
.
toList
());
List
<
ParamDefine
>
paramDefaultValue
=
appDefine
.
getParams
().
stream
()
.
filter
(
item
->
StringUtils
.
hasText
(
item
.
getDefaultValue
()))
.
collect
(
Collectors
.
toList
());
paramDefaultValue
.
forEach
(
defaultVar
->
{
if
(
configmaps
.
stream
().
noneMatch
(
item
->
item
.
getKey
().
equals
(
defaultVar
.
getField
())))
{
// todo type
Configmap
configmap
=
new
Configmap
(
defaultVar
.
getField
(),
defaultVar
.
getDefaultValue
(),
(
byte
)
1
);
configmaps
.
add
(
configmap
);
}
});
appDefine
.
setConfigmap
(
configmaps
);
// Issue collection tasks 下发采集任务
long
newJobId
=
collectJobService
.
addAsyncCollectJob
(
appDefine
);
...
...
manager/src/main/resources/define/app-almalinux.yml
浏览文件 @
fd2f058a
...
...
@@ -83,6 +83,21 @@ params:
defaultValue
:
6000
# field-param field key
# field-变量字段标识符
-
field
:
reuseConnection
# name-param field display i18n name
# name-参数字段显示名称
name
:
zh-CN
:
复用连接
en-US
:
Reuse Connection
# type-param field type(most mapping the html input type)
# type-字段类型,样式(大部分映射input标签type属性)
type
:
boolean
# required-true or false
# required-是否是必输项 true-必填 false-可选
required
:
true
defaultValue
:
true
# field-param field key
# field-变量字段标识符
-
field
:
username
# name-param field display i18n name
# name-参数字段显示名称
...
...
@@ -169,6 +184,7 @@ metrics:
# ssh private key
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
# ssh run collect script
script
:
(uname -r ; hostname ; uptime | awk -F "," '{print $1}' | sed "s/ //g") | sed ":a;N;s/\n/^/g;ta" | awk -F '^' 'BEGIN{print "version hostname uptime"} {print $1, $2, $3}'
# ssh response data parse type: oneRow, multiRow
...
...
@@ -217,6 +233,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
"
LANG=C
lscpu
|
awk
-F:
'/Model
name/
{print
$2}'
|
awk
'NR==1';awk
'/processor/{core++}
END{print
core}'
/proc/cpuinfo;uptime
|
sed
's/,/
/g'
|
awk
'{for(i=NF-2;i<=NF;i++)print
$i
}'
|
xargs;vmstat
1
1
|
awk
'NR==3{print
$11}';vmstat
1
1
|
awk
'NR==3{print
$12}';vmstat
1
2
|
awk
'NR==4{print
$15}'"
parseType
:
oneRow
...
...
@@ -262,6 +279,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
free -m | awk 'BEGIN{print "total used free buff_cache available"} NR==2{print $2,$3,$4,$6,$7}'
parseType
:
multiRow
...
...
@@ -290,6 +308,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
vmstat -D | awk 'NR==1{print $1}';vmstat -D | awk 'NR==2{print $1}';vmstat 1 1 | awk 'NR==3{print $10}';vmstat 1 1 | awk 'NR==3{print $9}';vmstat 1 1 | awk 'NR==3{print $16}'
parseType
:
oneRow
...
...
@@ -313,6 +332,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
cat /proc/net/dev | tail -n +3 | awk 'BEGIN{ print "interface_name receive_bytes transmit_bytes"} {print $1,$2,$10}'
parseType
:
multiRow
...
...
@@ -341,6 +361,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
df -m | tail -n +2 | awk 'BEGIN{ print "filesystem used available usage mounted"} {print $1,$3,$4,$5,$6}'
parseType
:
multiRow
...
...
@@ -366,6 +387,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
ps -aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {print $2, $3, $4, $11}'| head -n
10
parseType
:
multiRow
...
...
@@ -391,5 +413,6 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
ps -aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {print $2, $3, $4, $11}'| head -n
10
parseType
:
multiRow
manager/src/main/resources/define/app-centos.yml
浏览文件 @
fd2f058a
...
...
@@ -83,6 +83,21 @@ params:
defaultValue
:
6000
# field-param field key
# field-变量字段标识符
-
field
:
reuseConnection
# name-param field display i18n name
# name-参数字段显示名称
name
:
zh-CN
:
复用连接
en-US
:
Reuse Connection
# type-param field type(most mapping the html input type)
# type-字段类型,样式(大部分映射input标签type属性)
type
:
boolean
# required-true or false
# required-是否是必输项 true-必填 false-可选
required
:
true
defaultValue
:
true
# field-param field key
# field-变量字段标识符
-
field
:
username
# name-param field display i18n name
# name-参数字段显示名称
...
...
@@ -169,6 +184,7 @@ metrics:
# ssh private key
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
# ssh run collect script
script
:
(uname -r ; hostname ; uptime | awk -F "," '{print $1}' | sed "s/ //g") | sed ":a;N;s/\n/^/g;ta" | awk -F '^' 'BEGIN{print "version hostname uptime"} {print $1, $2, $3}'
# ssh response data parse type: oneRow, multiRow
...
...
@@ -217,6 +233,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
"
LANG=C
lscpu
|
awk
-F:
'/Model
name/
{print
$2}'
|
awk
'NR==1';awk
'/processor/{core++}
END{print
core}'
/proc/cpuinfo;uptime
|
sed
's/,/
/g'
|
awk
'{for(i=NF-2;i<=NF;i++)print
$i
}'
|
xargs;vmstat
1
1
|
awk
'NR==3{print
$11}';vmstat
1
1
|
awk
'NR==3{print
$12}';vmstat
1
2
|
awk
'NR==4{print
$15}'"
parseType
:
oneRow
...
...
@@ -262,6 +279,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
free -m | awk 'BEGIN{print "total used free buff_cache available"} NR==2{print $2,$3,$4,$6,$7}'
parseType
:
multiRow
...
...
@@ -290,6 +308,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
vmstat -D | awk 'NR==1{print $1}';vmstat -D | awk 'NR==2{print $1}';vmstat 1 1 | awk 'NR==3{print $10}';vmstat 1 1 | awk 'NR==3{print $9}';vmstat 1 1 | awk 'NR==3{print $16}'
parseType
:
oneRow
...
...
@@ -313,6 +332,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
cat /proc/net/dev | tail -n +3 | awk 'BEGIN{ print "interface_name receive_bytes transmit_bytes"} {print $1,$2,$10}'
parseType
:
multiRow
...
...
@@ -341,6 +361,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
df -m | tail -n +2 | awk 'BEGIN{ print "filesystem used available usage mounted"} {print $1,$3,$4,$5,$6}'
parseType
:
multiRow
...
...
@@ -366,6 +387,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
ps -aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {print $2, $3, $4, $11}'| head -n
10
parseType
:
multiRow
...
...
@@ -391,5 +413,6 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
ps -aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {print $2, $3, $4, $11}'| head -n
10
parseType
:
multiRow
manager/src/main/resources/define/app-coreos.yml
浏览文件 @
fd2f058a
...
...
@@ -83,6 +83,21 @@ params:
defaultValue
:
6000
# field-param field key
# field-变量字段标识符
-
field
:
reuseConnection
# name-param field display i18n name
# name-参数字段显示名称
name
:
zh-CN
:
复用连接
en-US
:
Reuse Connection
# type-param field type(most mapping the html input type)
# type-字段类型,样式(大部分映射input标签type属性)
type
:
boolean
# required-true or false
# required-是否是必输项 true-必填 false-可选
required
:
true
defaultValue
:
true
# field-param field key
# field-变量字段标识符
-
field
:
username
# name-param field display i18n name
# name-参数字段显示名称
...
...
@@ -169,6 +184,7 @@ metrics:
# ssh private key
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
# ssh run collect script
script
:
(uname -r ; hostname ; uptime | awk -F "," '{print $1}' | sed "s/ //g") | sed ":a;N;s/\n/^/g;ta" | awk -F '^' 'BEGIN{print "version hostname uptime"} {print $1, $2, $3}'
# ssh response data parse type: oneRow, multiRow
...
...
@@ -217,6 +233,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
"
LANG=C
lscpu
|
awk
-F:
'/Model
name/
{print
$2}'
|
awk
'NR==1';awk
'/processor/{core++}
END{print
core}'
/proc/cpuinfo;uptime
|
sed
's/,/
/g'
|
awk
'{for(i=NF-2;i<=NF;i++)print
$i
}'
|
xargs;vmstat
1
1
|
awk
'NR==3{print
$11}';vmstat
1
1
|
awk
'NR==3{print
$12}';vmstat
1
2
|
awk
'NR==4{print
$15}'"
parseType
:
oneRow
...
...
@@ -262,6 +279,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
free -m | awk 'BEGIN{print "total used free buff_cache available"} NR==2{print $2,$3,$4,$6,$7}'
parseType
:
multiRow
...
...
@@ -290,6 +308,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
vmstat -D | awk 'NR==1{print $1}';vmstat -D | awk 'NR==2{print $1}';vmstat 1 1 | awk 'NR==3{print $10}';vmstat 1 1 | awk 'NR==3{print $9}';vmstat 1 1 | awk 'NR==3{print $16}'
parseType
:
oneRow
...
...
@@ -313,6 +332,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
cat /proc/net/dev | tail -n +3 | awk 'BEGIN{ print "interface_name receive_bytes transmit_bytes"} {print $1,$2,$10}'
parseType
:
multiRow
...
...
@@ -341,6 +361,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
df -m | tail -n +2 | awk 'BEGIN{ print "filesystem used available usage mounted"} {print $1,$3,$4,$5,$6}'
parseType
:
multiRow
...
...
@@ -366,6 +387,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
ps -aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {print $2, $3, $4, $11}'| head -n
10
parseType
:
multiRow
...
...
@@ -391,5 +413,6 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
ps -aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {print $2, $3, $4, $11}'| head -n
10
parseType
:
multiRow
manager/src/main/resources/define/app-debian.yml
浏览文件 @
fd2f058a
...
...
@@ -83,6 +83,21 @@ params:
defaultValue
:
6000
# field-param field key
# field-变量字段标识符
-
field
:
reuseConnection
# name-param field display i18n name
# name-参数字段显示名称
name
:
zh-CN
:
复用连接
en-US
:
Reuse Connection
# type-param field type(most mapping the html input type)
# type-字段类型,样式(大部分映射input标签type属性)
type
:
boolean
# required-true or false
# required-是否是必输项 true-必填 false-可选
required
:
true
defaultValue
:
true
# field-param field key
# field-变量字段标识符
-
field
:
username
# name-param field display i18n name
# name-参数字段显示名称
...
...
@@ -169,6 +184,7 @@ metrics:
# ssh private key
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
# ssh run collect script
script
:
(uname -r ; hostname ; uptime | awk -F "," '{print $1}' | sed "s/ //g") | sed ":a;N;s/\n/^/g;ta" | awk -F '^' 'BEGIN{print "version hostname uptime"} {print $1, $2, $3}'
# ssh response data parse type: oneRow, multiRow
...
...
@@ -217,6 +233,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
"
LANG=C
lscpu
|
awk
-F:
'$1==
\"
Model
name
\"
{print
$2}';awk
'/processor/{core++}
END{print
core}'
/proc/cpuinfo;uptime
|
sed
's/,/
/g'
|
awk
'{for(i=NF-2;i<=NF;i++)print
$i
}'
|
xargs;vmstat
1
1
|
awk
'NR==3{print
$11}';vmstat
1
1
|
awk
'NR==3{print
$12}';vmstat
1
2
|
awk
'NR==4{print
$15}'"
parseType
:
oneRow
...
...
@@ -262,6 +279,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
free -m | awk 'BEGIN{print "total used free buff_cache available"} NR==2{print $2,$3,$4,$6,$7}'
parseType
:
multiRow
...
...
@@ -290,6 +308,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
vmstat -D | awk 'NR==1{print $1}';vmstat -D | awk 'NR==2{print $1}';vmstat 1 1 | awk 'NR==3{print $10}';vmstat 1 1 | awk 'NR==3{print $9}';vmstat 1 1 | awk 'NR==3{print $16}'
parseType
:
oneRow
...
...
@@ -313,6 +332,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
cat /proc/net/dev | tail -n +3 | awk 'BEGIN{ print "interface_name receive_bytes transmit_bytes"} {print $1,$2,$10}'
parseType
:
multiRow
...
...
@@ -341,6 +361,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
df -m | tail -n +2 | awk 'BEGIN{ print "filesystem used available usage mounted"} {print $1,$3,$4,$5,$6}'
parseType
:
multiRow
...
...
@@ -366,6 +387,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
ps -aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {print $2, $3, $4, $11}'| head -n
10
parseType
:
multiRow
...
...
@@ -391,5 +413,6 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
ps -aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {print $2, $3, $4, $11}'| head -n
10
parseType
:
multiRow
manager/src/main/resources/define/app-euleros.yml
浏览文件 @
fd2f058a
...
...
@@ -83,6 +83,21 @@ params:
defaultValue
:
6000
# field-param field key
# field-变量字段标识符
-
field
:
reuseConnection
# name-param field display i18n name
# name-参数字段显示名称
name
:
zh-CN
:
复用连接
en-US
:
Reuse Connection
# type-param field type(most mapping the html input type)
# type-字段类型,样式(大部分映射input标签type属性)
type
:
boolean
# required-true or false
# required-是否是必输项 true-必填 false-可选
required
:
true
defaultValue
:
true
# field-param field key
# field-变量字段标识符
-
field
:
username
# name-param field display i18n name
# name-参数字段显示名称
...
...
@@ -169,6 +184,7 @@ metrics:
# ssh private key
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
# ssh run collect script
script
:
(uname -r ; hostname ; uptime | awk -F "," '{print $1}' | sed "s/ //g") | sed ":a;N;s/\n/^/g;ta" | awk -F '^' 'BEGIN{print "version hostname uptime"} {print $1, $2, $3}'
# ssh response data parse type: oneRow, multiRow
...
...
@@ -217,6 +233,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
"
LANG=C
lscpu
|
awk
-F:
'$1==
\"
Model
name
\"
{print
$2}';awk
'/processor/{core++}
END{print
core}'
/proc/cpuinfo;uptime
|
sed
's/,/
/g'
|
awk
'{for(i=NF-2;i<=NF;i++)print
$i
}'
|
xargs;vmstat
1
1
|
awk
'NR==3{print
$11}';vmstat
1
1
|
awk
'NR==3{print
$12}';vmstat
1
2
|
awk
'NR==4{print
$15}'"
parseType
:
oneRow
...
...
@@ -262,6 +279,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
free -m | awk 'BEGIN{print "total used free buff_cache available"} NR==2{print $2,$3,$4,$6,$7}'
parseType
:
multiRow
...
...
@@ -290,6 +308,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
vmstat -D | awk 'NR==1{print $1}';vmstat -D | awk 'NR==2{print $1}';vmstat 1 1 | awk 'NR==3{print $10}';vmstat 1 1 | awk 'NR==3{print $9}';vmstat 1 1 | awk 'NR==3{print $16}'
parseType
:
oneRow
...
...
@@ -313,6 +332,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
cat /proc/net/dev | tail -n +3 | awk 'BEGIN{ print "interface_name receive_bytes transmit_bytes"} {print $1,$2,$10}'
parseType
:
multiRow
...
...
@@ -341,6 +361,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
df -m | tail -n +2 | awk 'BEGIN{ print "filesystem used available usage mounted"} {print $1,$3,$4,$5,$6}'
parseType
:
multiRow
...
...
@@ -366,6 +387,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
ps -aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {print $2, $3, $4, $11}'| head -n
10
parseType
:
multiRow
...
...
@@ -391,5 +413,6 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
ps -aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {print $2, $3, $4, $11}'| head -n
10
parseType
:
multiRow
manager/src/main/resources/define/app-freebsd.yml
浏览文件 @
fd2f058a
...
...
@@ -83,6 +83,21 @@ params:
defaultValue
:
6000
# field-param field key
# field-变量字段标识符
-
field
:
reuseConnection
# name-param field display i18n name
# name-参数字段显示名称
name
:
zh-CN
:
复用连接
en-US
:
Reuse Connection
# type-param field type(most mapping the html input type)
# type-字段类型,样式(大部分映射input标签type属性)
type
:
boolean
# required-true or false
# required-是否是必输项 true-必填 false-可选
required
:
true
defaultValue
:
true
# field-param field key
# field-变量字段标识符
-
field
:
username
# name-param field display i18n name
# name-参数字段显示名称
...
...
@@ -169,6 +184,7 @@ metrics:
# ssh private key
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
# ssh run collect script
script
:
uname -r ; hostname ; uptime | awk -F "," '{print $1}' | sed "s/ //g"
# ssh response data parse type: oneRow, multiRow
...
...
@@ -217,6 +233,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
"
dmesg
|
grep
-i
cpu
|
awk
'NR==1';sysctl
hw.ncpu
|
awk
'{print
$2}';uptime
|
sed
's/,/
/g'
|
awk
'{for(i=NF-2;i<=NF;i++)print
$i
}'
|
xargs;vmstat
1
1
|
awk
'NR==3{print
$11}';vmstat
1
1
|
awk
'NR==3{print
$12}';vmstat
1
2
|
awk
'NR==4{print
$15}'"
parseType
:
oneRow
...
...
@@ -262,6 +279,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
sysctl hw | egrep 'hw.(phys|user|real)' | awk '{print $2}';dmesg | grep memory | grep avail | awk '{print $4}';
parseType
:
oneRow
...
...
@@ -290,6 +308,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
df -m | tail -n +2 | awk 'BEGIN{ print "filesystem used available usage mounted"} {print $1,$3,$4,$5,$6}'
parseType
:
multiRow
...
...
@@ -315,6 +334,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
ps -aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {print $2, $3, $4, $11}'| head -n
10
parseType
:
multiRow
...
...
@@ -340,5 +360,6 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
ps -aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {print $2, $3, $4, $11}'| head -n
10
parseType
:
multiRow
manager/src/main/resources/define/app-linux.yml
浏览文件 @
fd2f058a
...
...
@@ -83,6 +83,21 @@ params:
defaultValue
:
6000
# field-param field key
# field-变量字段标识符
-
field
:
reuseConnection
# name-param field display i18n name
# name-参数字段显示名称
name
:
zh-CN
:
复用连接
en-US
:
Reuse Connection
# type-param field type(most mapping the html input type)
# type-字段类型,样式(大部分映射input标签type属性)
type
:
boolean
# required-true or false
# required-是否是必输项 true-必填 false-可选
required
:
true
defaultValue
:
true
# field-param field key
# field-变量字段标识符
-
field
:
username
# name-param field display i18n name
# name-参数字段显示名称
...
...
@@ -169,6 +184,7 @@ metrics:
# ssh private key
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
# ssh run collect script
script
:
(uname -r ; hostname ; uptime | awk -F "," '{print $1}' | sed "s/ //g") | sed ":a;N;s/\n/^/g;ta" | awk -F '^' 'BEGIN{print "version hostname uptime"} {print $1, $2, $3}'
# ssh response data parse type: oneRow, multiRow
...
...
@@ -217,6 +233,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
"
LANG=C
lscpu
|
awk
-F:
'$1==
\"
Model
name
\"
{print
$2}';awk
'/processor/{core++}
END{print
core}'
/proc/cpuinfo;uptime
|
sed
's/,/
/g'
|
awk
'{for(i=NF-2;i<=NF;i++)print
$i
}'
|
xargs;vmstat
1
1
|
awk
'NR==3{print
$11}';vmstat
1
1
|
awk
'NR==3{print
$12}';vmstat
1
2
|
awk
'NR==4{print
$15}'"
parseType
:
oneRow
...
...
@@ -262,6 +279,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
free -m | awk 'BEGIN{print "total used free buff_cache available"} NR==2{print $2,$3,$4,$6,$7}'
parseType
:
multiRow
...
...
@@ -290,6 +308,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
vmstat -D | awk 'NR==1{print $1}';vmstat -D | awk 'NR==2{print $1}';vmstat 1 1 | awk 'NR==3{print $10}';vmstat 1 1 | awk 'NR==3{print $9}';vmstat 1 1 | awk 'NR==3{print $16}'
parseType
:
oneRow
...
...
@@ -313,6 +332,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
cat /proc/net/dev | tail -n +3 | awk 'BEGIN{ print "interface_name receive_bytes transmit_bytes"} {print $1,$2,$10}'
parseType
:
multiRow
...
...
@@ -341,6 +361,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
df -mP | tail -n +2 | awk 'BEGIN{ print "filesystem used available usage mounted"} {print $1,$3,$4,$5,$6}'
parseType
:
multiRow
...
...
@@ -366,6 +387,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
ps -aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {print $2, $3, $4, $11}'| head -n
10
parseType
:
multiRow
...
...
@@ -391,5 +413,6 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
ps -aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {print $2, $3, $4, $11}'| head -n
10
parseType
:
multiRow
manager/src/main/resources/define/app-opensuse.yml
浏览文件 @
fd2f058a
...
...
@@ -83,6 +83,21 @@ params:
defaultValue
:
6000
# field-param field key
# field-变量字段标识符
-
field
:
reuseConnection
# name-param field display i18n name
# name-参数字段显示名称
name
:
zh-CN
:
复用连接
en-US
:
Reuse Connection
# type-param field type(most mapping the html input type)
# type-字段类型,样式(大部分映射input标签type属性)
type
:
boolean
# required-true or false
# required-是否是必输项 true-必填 false-可选
required
:
true
defaultValue
:
true
# field-param field key
# field-变量字段标识符
-
field
:
username
# name-param field display i18n name
# name-参数字段显示名称
...
...
@@ -169,6 +184,7 @@ metrics:
# ssh private key
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
# ssh run collect script
script
:
(uname -r ; hostname ; uptime | awk -F "," '{print $1}' | sed "s/ //g") | sed ":a;N;s/\n/^/g;ta" | awk -F '^' 'BEGIN{print "version hostname uptime"} {print $1, $2, $3}'
# ssh response data parse type: oneRow, multiRow
...
...
@@ -217,6 +233,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
"
LANG=C
lscpu
|
awk
-F:
'$1==
\"
Model
name
\"
{print
$2}';awk
'/processor/{core++}
END{print
core}'
/proc/cpuinfo;uptime
|
sed
's/,/
/g'
|
awk
'{for(i=NF-2;i<=NF;i++)print
$i
}'
|
xargs;vmstat
1
1
|
awk
'NR==3{print
$11}';vmstat
1
1
|
awk
'NR==3{print
$12}';vmstat
1
2
|
awk
'NR==4{print
$15}'"
parseType
:
oneRow
...
...
@@ -262,6 +279,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
free -m | awk 'BEGIN{print "total used free buff_cache available"} NR==2{print $2,$3,$4,$6,$7}'
parseType
:
multiRow
...
...
@@ -290,6 +308,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
vmstat -D | awk 'NR==1{print $1}';vmstat -D | awk 'NR==2{print $1}';vmstat 1 1 | awk 'NR==3{print $10}';vmstat 1 1 | awk 'NR==3{print $9}';vmstat 1 1 | awk 'NR==3{print $16}'
parseType
:
oneRow
...
...
@@ -313,6 +332,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
cat /proc/net/dev | tail -n +3 | awk 'BEGIN{ print "interface_name receive_bytes transmit_bytes"} {print $1,$2,$10}'
parseType
:
multiRow
...
...
@@ -341,6 +361,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
df -m | tail -n +2 | awk 'BEGIN{ print "filesystem used available usage mounted"} {print $1,$3,$4,$5,$6}'
parseType
:
multiRow
...
...
@@ -366,6 +387,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
ps -aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {print $2, $3, $4, $11}'| head -n
10
parseType
:
multiRow
...
...
@@ -391,5 +413,6 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
ps -aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {print $2, $3, $4, $11}'| head -n
10
parseType
:
multiRow
manager/src/main/resources/define/app-oracle.yml
浏览文件 @
fd2f058a
...
...
@@ -313,11 +313,11 @@ metrics:
type
:
1
instance
:
true
-
field
:
total
type
:
1
type
:
0
-
field
:
used
type
:
1
type
:
0
-
field
:
free
type
:
1
type
:
0
-
field
:
used_percentage
type
:
0
unit
:
'
%'
...
...
manager/src/main/resources/define/app-redhat.yml
浏览文件 @
fd2f058a
...
...
@@ -83,6 +83,21 @@ params:
defaultValue
:
6000
# field-param field key
# field-变量字段标识符
-
field
:
reuseConnection
# name-param field display i18n name
# name-参数字段显示名称
name
:
zh-CN
:
复用连接
en-US
:
Reuse Connection
# type-param field type(most mapping the html input type)
# type-字段类型,样式(大部分映射input标签type属性)
type
:
boolean
# required-true or false
# required-是否是必输项 true-必填 false-可选
required
:
true
defaultValue
:
true
# field-param field key
# field-变量字段标识符
-
field
:
username
# name-param field display i18n name
# name-参数字段显示名称
...
...
@@ -169,6 +184,7 @@ metrics:
# ssh private key
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
# ssh run collect script
script
:
(uname -r ; hostname ; uptime | awk -F "," '{print $1}' | sed "s/ //g") | sed ":a;N;s/\n/^/g;ta" | awk -F '^' 'BEGIN{print "version hostname uptime"} {print $1, $2, $3}'
# ssh response data parse type: oneRow, multiRow
...
...
@@ -217,6 +233,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
"
LANG=C
lscpu
|
awk
-F:
'$1==
\"
Model
name
\"
{print
$2}';awk
'/processor/{core++}
END{print
core}'
/proc/cpuinfo;uptime
|
sed
's/,/
/g'
|
awk
'{for(i=NF-2;i<=NF;i++)print
$i
}'
|
xargs;vmstat
1
1
|
awk
'NR==3{print
$11}';vmstat
1
1
|
awk
'NR==3{print
$12}';vmstat
1
2
|
awk
'NR==4{print
$15}'"
parseType
:
oneRow
...
...
@@ -262,6 +279,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
free -m | awk 'BEGIN{print "total used free buff_cache available"} NR==2{print $2,$3,$4,$6,$7}'
parseType
:
multiRow
...
...
@@ -290,6 +308,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
vmstat -D | awk 'NR==1{print $1}';vmstat -D | awk 'NR==2{print $1}';vmstat 1 1 | awk 'NR==3{print $10}';vmstat 1 1 | awk 'NR==3{print $9}';vmstat 1 1 | awk 'NR==3{print $16}'
parseType
:
oneRow
...
...
@@ -313,6 +332,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
cat /proc/net/dev | tail -n +3 | awk 'BEGIN{ print "interface_name receive_bytes transmit_bytes"} {print $1,$2,$10}'
parseType
:
multiRow
...
...
@@ -341,6 +361,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
df -m | tail -n +2 | awk 'BEGIN{ print "filesystem used available usage mounted"} {print $1,$3,$4,$5,$6}'
parseType
:
multiRow
...
...
@@ -366,6 +387,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
ps -aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {print $2, $3, $4, $11}'| head -n
10
parseType
:
multiRow
...
...
@@ -391,5 +413,6 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
ps -aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {print $2, $3, $4, $11}'| head -n
10
parseType
:
multiRow
manager/src/main/resources/define/app-rockylinux.yml
浏览文件 @
fd2f058a
...
...
@@ -83,6 +83,21 @@ params:
defaultValue
:
6000
# field-param field key
# field-变量字段标识符
-
field
:
reuseConnection
# name-param field display i18n name
# name-参数字段显示名称
name
:
zh-CN
:
复用连接
en-US
:
Reuse Connection
# type-param field type(most mapping the html input type)
# type-字段类型,样式(大部分映射input标签type属性)
type
:
boolean
# required-true or false
# required-是否是必输项 true-必填 false-可选
required
:
true
defaultValue
:
true
# field-param field key
# field-变量字段标识符
-
field
:
username
# name-param field display i18n name
# name-参数字段显示名称
...
...
@@ -169,6 +184,7 @@ metrics:
# ssh private key
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
# ssh run collect script
script
:
(uname -r ; hostname ; uptime | awk -F "," '{print $1}' | sed "s/ //g") | sed ":a;N;s/\n/^/g;ta" | awk -F '^' 'BEGIN{print "version hostname uptime"} {print $1, $2, $3}'
# ssh response data parse type: oneRow, multiRow
...
...
@@ -217,6 +233,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
"
LANG=C
lscpu
|
awk
-F:
'/Model
name/
{print
$2}'
|
awk
'NR==1';awk
'/processor/{core++}
END{print
core}'
/proc/cpuinfo;uptime
|
sed
's/,/
/g'
|
awk
'{for(i=NF-2;i<=NF;i++)print
$i
}'
|
xargs;vmstat
1
1
|
awk
'NR==3{print
$11}';vmstat
1
1
|
awk
'NR==3{print
$12}';vmstat
1
2
|
awk
'NR==4{print
$15}'"
parseType
:
oneRow
...
...
@@ -262,6 +279,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
free -m | awk 'BEGIN{print "total used free buff_cache available"} NR==2{print $2,$3,$4,$6,$7}'
parseType
:
multiRow
...
...
@@ -290,6 +308,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
vmstat -D | awk 'NR==1{print $1}';vmstat -D | awk 'NR==2{print $1}';vmstat 1 1 | awk 'NR==3{print $10}';vmstat 1 1 | awk 'NR==3{print $9}';vmstat 1 1 | awk 'NR==3{print $16}'
parseType
:
oneRow
...
...
@@ -313,6 +332,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
cat /proc/net/dev | tail -n +3 | awk 'BEGIN{ print "interface_name receive_bytes transmit_bytes"} {print $1,$2,$10}'
parseType
:
multiRow
...
...
@@ -341,6 +361,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
df -m | tail -n +2 | awk 'BEGIN{ print "filesystem used available usage mounted"} {print $1,$3,$4,$5,$6}'
parseType
:
multiRow
...
...
@@ -366,6 +387,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
ps -aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {print $2, $3, $4, $11}'| head -n
10
parseType
:
multiRow
...
...
@@ -391,5 +413,6 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
ps -aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {print $2, $3, $4, $11}'| head -n
10
parseType
:
multiRow
manager/src/main/resources/define/app-ubuntu.yml
浏览文件 @
fd2f058a
...
...
@@ -83,6 +83,21 @@ params:
defaultValue
:
6000
# field-param field key
# field-变量字段标识符
-
field
:
reuseConnection
# name-param field display i18n name
# name-参数字段显示名称
name
:
zh-CN
:
复用连接
en-US
:
Reuse Connection
# type-param field type(most mapping the html input type)
# type-字段类型,样式(大部分映射input标签type属性)
type
:
boolean
# required-true or false
# required-是否是必输项 true-必填 false-可选
required
:
true
defaultValue
:
true
# field-param field key
# field-变量字段标识符
-
field
:
username
# name-param field display i18n name
# name-参数字段显示名称
...
...
@@ -169,6 +184,7 @@ metrics:
# ssh private key
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
# ssh run collect script
script
:
(uname -r ; hostname ; uptime | awk -F "," '{print $1}' | sed "s/ //g") | sed ":a;N;s/\n/^/g;ta" | awk -F '^' 'BEGIN{print "version hostname uptime"} {print $1, $2, $3}'
# ssh response data parse type: oneRow, multiRow
...
...
@@ -220,6 +236,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
"
LANG=C
lscpu
|
awk
-F:
'/Model
name/
{print
$2}';awk
'/processor/{core++}
END{print
core}'
/proc/cpuinfo;uptime
|
sed
's/,/
/g'
|
awk
'{for(i=NF-2;i<=NF;i++)print
$i
}'
|
xargs;vmstat
1
1
|
awk
'NR==3{print
$11}';vmstat
1
1
|
awk
'NR==3{print
$12}';vmstat
1
2
|
awk
'NR==4{print
$15}'"
parseType
:
oneRow
...
...
@@ -265,6 +282,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
free -m | awk 'BEGIN{print "total used free buff_cache available"} NR==2{print $2,$3,$4,$6,$7}'
parseType
:
multiRow
...
...
@@ -294,6 +312,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
vmstat -D | awk 'NR==1{print $1}';vmstat -D | awk 'NR==2{print $1}';vmstat 1 1 | awk 'NR==3{print $10}';vmstat 1 1 | awk 'NR==3{print $9}';vmstat 1 1 | awk 'NR==3{print $16}'
parseType
:
oneRow
...
...
@@ -317,6 +336,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
cat /proc/net/dev | tail -n +3 | awk 'BEGIN{ print "interface_name receive_bytes transmit_bytes"} {print $1,$2,$10}'
parseType
:
multiRow
...
...
@@ -345,6 +365,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
df -m | tail -n +2 | awk 'BEGIN{ print "filesystem used available usage mounted"} {print $1,$3,$4,$5,$6}'
parseType
:
multiRow
...
...
@@ -370,6 +391,7 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
ps -aux | sort -k3nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {print $2, $3, $4, $11}'| head -n
10
parseType
:
multiRow
...
...
@@ -395,5 +417,6 @@ metrics:
password
:
^_^password^_^
privateKey
:
^_^privateKey^_^
timeout
:
^_^timeout^_^
reuseConnection
:
^_^reuseConnection^_^
script
:
ps -aux | sort -k4nr | awk 'BEGIN{ print "pid cpu_usage mem_usage command" } {print $2, $3, $4, $11}'| head -n
10
parseType
:
multiRow
manager/src/test/java/org/dromara/hertzbeat/manager/service/MonitorServiceTest.java
浏览文件 @
fd2f058a
...
...
@@ -649,6 +649,7 @@ class MonitorServiceTest {
when
(
monitorDao
.
findMonitorsByIdIn
(
ids
)).
thenReturn
(
monitors
);
Job
job
=
new
Job
();
job
.
setMetrics
(
new
ArrayList
<>());
job
.
setParams
(
new
ArrayList
<>());
when
(
appService
.
getAppDefine
(
monitors
.
get
(
0
).
getApp
())).
thenReturn
(
job
);
List
<
Param
>
params
=
Collections
.
singletonList
(
new
Param
());
when
(
paramDao
.
findParamsByMonitorId
(
monitors
.
get
(
0
).
getId
())).
thenReturn
(
params
);
...
...
web-app/src/app/routes/monitor/monitor-edit/monitor-edit.component.ts
浏览文件 @
fd2f058a
...
...
@@ -101,10 +101,17 @@ export class MonitorEditComponent implements OnInit {
param
.
type
=
1
;
}
if
(
define
.
type
===
'
boolean
'
)
{
param
.
value
=
false
;
}
if
(
param
.
field
===
'
host
'
)
{
param
.
value
=
define
.
defaultValue
==
'
true
'
;
}
else
if
(
param
.
field
===
'
host
'
)
{
param
.
value
=
this
.
monitor
.
host
;
}
else
if
(
define
.
defaultValue
!=
undefined
)
{
if
(
define
.
type
===
'
number
'
)
{
param
.
value
=
Number
(
define
.
defaultValue
);
}
else
if
(
define
.
type
===
'
boolean
'
)
{
param
.
value
=
define
.
defaultValue
.
toLowerCase
()
==
'
true
'
;
}
else
{
param
.
value
=
define
.
defaultValue
;
}
}
}
else
{
if
(
define
.
type
===
'
boolean
'
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录