diff --git a/collector/src/main/java/org/dromara/hertzbeat/collector/dispatch/entrance/processor/GoCloseProcessor.java b/collector/src/main/java/org/dromara/hertzbeat/collector/dispatch/entrance/processor/GoCloseProcessor.java index 0802910e275..27da4a9c0e2 100644 --- a/collector/src/main/java/org/dromara/hertzbeat/collector/dispatch/entrance/processor/GoCloseProcessor.java +++ b/collector/src/main/java/org/dromara/hertzbeat/collector/dispatch/entrance/processor/GoCloseProcessor.java @@ -29,7 +29,7 @@ public ClusterMsg.Message handle(ChannelHandlerContext ctx, ClusterMsg.Message m this.timerDispatch = SpringContextHolder.getBean(TimerDispatch.class); } if (message.getMsg().contains(CommonConstants.COLLECTOR_AUTH_FAILED)) { - log.error("receive client auth failed message and go close. {}", message.getMsg()); + log.error("[Auth Failed]receive client auth failed message and go close. {}", message.getMsg()); } this.timerDispatch.goOffline(); this.collectServer.shutdown(); diff --git a/collector/src/main/java/org/dromara/hertzbeat/collector/dispatch/entrance/processor/GoOfflineProcessor.java b/collector/src/main/java/org/dromara/hertzbeat/collector/dispatch/entrance/processor/GoOfflineProcessor.java index 85bdd8784fd..4d464aa7749 100644 --- a/collector/src/main/java/org/dromara/hertzbeat/collector/dispatch/entrance/processor/GoOfflineProcessor.java +++ b/collector/src/main/java/org/dromara/hertzbeat/collector/dispatch/entrance/processor/GoOfflineProcessor.java @@ -26,7 +26,7 @@ public ClusterMsg.Message handle(ChannelHandlerContext ctx, ClusterMsg.Message m log.info("receive offline message and handle success"); message.getMsg(); if (message.getMsg().contains(CommonConstants.COLLECTOR_AUTH_FAILED)) { - log.error("receive client auth failed message and go offline. {}", message.getMsg()); + log.error("[Auth Failed]receive client auth failed message and go offline. {}", message.getMsg()); return null; } return ClusterMsg.Message.newBuilder() diff --git a/manager/src/main/java/org/dromara/hertzbeat/manager/scheduler/SchedulerInit.java b/manager/src/main/java/org/dromara/hertzbeat/manager/scheduler/SchedulerInit.java index 51b3e17f4a9..5633e5a0c33 100644 --- a/manager/src/main/java/org/dromara/hertzbeat/manager/scheduler/SchedulerInit.java +++ b/manager/src/main/java/org/dromara/hertzbeat/manager/scheduler/SchedulerInit.java @@ -73,7 +73,7 @@ public void run(String... args) throws Exception { .build(); collectorScheduling.collectorGoOnline(CommonConstants.MAIN_COLLECTOR_NODE, collectorInfo); // init jobs - List monitors = monitorDao.findMonitorsByStatusNotInAndAndJobIdNotNull(Arrays.asList((byte) 0, (byte) 4)); + List monitors = monitorDao.findMonitorsByStatusNotInAndAndJobIdNotNull(List.of((byte) 0)); List monitorBinds = collectorMonitorBindDao.findAll(); Map monitorIdCollectorMap = monitorBinds.stream().collect( Collectors.toMap(CollectorMonitorBind::getMonitorId, CollectorMonitorBind::getCollector)); diff --git a/manager/src/main/resources/define/app-api_code.yml b/manager/src/main/resources/define/app-api_code.yml index 213df6c98c6..751f815c8d8 100644 --- a/manager/src/main/resources/define/app-api_code.yml +++ b/manager/src/main/resources/define/app-api_code.yml @@ -15,20 +15,20 @@ # The monitoring type category:service-application service monitoring db-database monitoring custom-custom monitoring os-operating system monitoring # 监控类型所属类别:service-应用服务 program-应用程序 db-数据库 custom-自定义 os-操作系统 bigdata-大数据 mid-中间件 webserver-web服务器 cache-缓存 cn-云原生 network-网络监控等等 -category: custom +category: service # 监控应用类型名称(与文件名保持一致) eg: linux windows tomcat mysql aws... app: api_code # The app api i18n name # app api国际化名称 name: zh-CN: API Code - en-US: API Code + en-US: API业务状态码 # The description and help of this monitoring type # 监控类型的帮助描述信息 help: - zh-CN: Hertzbeat 对 api 返回的状态码进行监控。
您可以点击 “新建 API Code” 并进行配置,或者选择“更多操作”,导入已有配置。 - en-US: Hertzbeat monitors the status codes which returned by the API. You could click the "New API Codes" button and proceed with the configuration or import an existing setup through the "More Actions" menu. - zh-TW: Hertzbeat對api返回的狀態碼進行監控。
您可以點擊“新建API Code”並進行配寘,或者選擇“更多操作”,導入已有配寘。 + zh-CN: 监控 HTTP API 接口,对 API 返回的业务自定义状态码(非 Http 状态码)进行监控。此需通过配置 JsonPath 来解析您 API 的业务状态码路径。
您可以点击 “新建 API Code” 并进行配置,或者选择“更多操作”,导入已有配置。 + en-US: Monitor HTTP API to monitor business-defined status codes (non-HTTP status codes) returned by API. To do this, you need to configure JsonPath to resolve the business status code path of your API.
You could click the "New API Codes" button and proceed with the configuration or import an existing setup through the "More Actions" menu. + zh-TW: 監控 HTTP API 接口,對 API 返回的業務自定義狀態碼(非 Http 狀態碼)進行監控。此需通過配置 JsonPath 來解析您 API 的業務狀態碼路徑。
您可以點擊“新建API Code”並進行配寘,或者選擇“更多操作”,導入已有配寘。 helpLink: zh-CN: https://hertzbeat.com/zh-cn/docs/help/api_code en-US: https://hertzbeat.com/docs/help/api_code @@ -151,8 +151,8 @@ params: # name-param field display i18n name # name-参数字段显示名称 name: - zh-CN: JsonPath解析路径 - en-US: JsonPath + zh-CN: JsonPath解析状态码路径 + en-US: JsonPath Parse Code # type-param field type(most mapping the html input type) # type-字段类型,样式(大部分映射input标签type属性) type: text @@ -351,14 +351,31 @@ params: hide: true metrics: + # metrics - status + # 监控指标 - status - name: status + i18n: + zh-CN: 状态 + en-US: Status + # metrics scheduling priority(0->127)->(high->low), metrics with the same priority will be scheduled in parallel + # priority 0's metrics is availability metrics, it will be scheduled first, only availability metrics collect success will the scheduling continue + # 指标采集调度优先级(0->127)->(优先级高->低) 优先级低的指标会等优先级高的指标采集完成后才会被调度, 相同优先级的指标会并行调度采集 + # 优先级为0的指标为可用性指标,即它会被首先调度,采集成功才会继续调度其它指标,采集失败则中断调度 priority: 0 fields: + # field-metric name, type-metric type(0-number,1-string), unit-metric unit('%','ms','MB'), label-whether it is a metrics label field + # field-指标名称, type-指标类型(0-number数字,1-string字符串), unit-指标单位('%','ms','MB'), label-是否是指标标签字段 - field: responseTime type: 0 unit: ms + i18n: + zh-CN: 响应时间 + en-US: ResponseTime - field: code - type: 0 + type: 1 + i18n: + zh-CN: 业务状态码 + en-US: Status Code aliasFields: - ^_^jsonPath^_^ - responseTime diff --git a/manager/src/main/resources/define/app-windows.yml b/manager/src/main/resources/define/app-windows.yml index 26f5ee918ad..e5ea1153ab1 100644 --- a/manager/src/main/resources/define/app-windows.yml +++ b/manager/src/main/resources/define/app-windows.yml @@ -13,15 +13,17 @@ # See the License for the specific language governing permissions and # limitations under the License. - # The monitoring type category:service-application service monitoring db-database monitoring mid-middleware custom-custom monitoring os-operating system monitoring # 监控类型所属类别:service-应用服务 program-应用程序 db-数据库 custom-自定义 os-操作系统 bigdata-大数据 mid-中间件 webserver-web服务器 cache-缓存 cn-云原生 network-网络监控等等 category: os +# The monitoring type eg: linux windows tomcat mysql aws... +# 监控类型 eg: linux windows tomcat mysql aws... app: windows +# The monitoring i18n name +# 监控类型国际化名称 name: zh-CN: Windows操作系统 en-US: OS Windows - # The description and help of this monitoring type # 监控类型的帮助描述信息 help: @@ -34,49 +36,103 @@ helpLink: # 监控所需输入参数定义(根据定义渲染页面UI) # Input params define for monitoring(render web ui by the definition) params: + # field-param field key + # field-变量字段标识符 - field: host + # name-param field display i18n name + # name-参数字段显示名称 name: - zh-CN: 主机Host - en-US: Host + zh-CN: 目标Host + en-US: Target Host # type-param field type(most mapping the html input type) # type-字段类型,样式(大部分映射input标签type属性) type: host + # required-true or false + # required-是否是必输项 true-必填 false-可选 required: true + # field-param field key + # field-变量字段标识符 - field: port + # name-param field display i18n name + # name-参数字段显示名称 name: zh-CN: 端口 en-US: Port + # type-param field type(most mapping the html input type) + # type-字段类型,样式(大部分映射input标签type属性) type: number + # when type is number, range is required + # 当type为number时,用range表示范围 range: '[0,65535]' + # required-true or false + # required-是否是必输项 true-必填 false-可选 required: true + # default value + # 默认值 defaultValue: 161 + # field-param field key + # field-变量字段标识符 - field: version + # name-param field display i18n name + # name-参数字段显示名称 name: zh-CN: SNMP 版本 en-US: SNMP Version + # type-param field type(radio mapping the html radio tag) + # type-当type为radio时,前端用radio展示开关 type: radio + # required-true or false + # required-是否是必输项 true-必填 false-可选 required: true + # when type is radio checkbox, use option to show optional values {name1:value1,name2:value2} + # 当type为radio单选框, checkbox复选框时, option表示可选项值列表 {name1:value1,name2:value2} options: - label: SNMPv1 value: 0 - label: SNMPv2c value: 1 + # field-param field key + # field-变量字段标识符 - field: community + # name-param field display i18n name + # name-参数字段显示名称 name: zh-CN: SNMP 团体字 en-US: SNMP Community + # type-param field type(most mapping the html input type) + # type-字段类型,样式(大部分映射input标签type属性) type: text + # when type is text, use limit to limit string length + # 当type为text时,用limit表示字符串限制大小 limit: 100 + # required-true or false + # required-是否是必输项 true-必填 false-可选 required: true + # 参数输入框提示信息 + # param field input placeholder placeholder: 'Snmp community for v1 v2c' + # field-param field key + # field-变量字段标识符 - field: timeout + # name-param field display i18n name + # name-参数字段显示名称 name: zh-CN: 超时时间(ms) en-US: Timeout(ms) + # type-param field type(most mapping the html input type) + # type-字段类型,样式(大部分映射input标签type属性) type: number + # when type is number, range is required + # 当type为number时,用range表示范围 range: '[0,100000]' + # required-true or false + # required-是否是必输项 true-必填 false-可选 required: false + # hide-is hide this field and put it in advanced layout + # hide-是否隐藏此参数将其放入高级设置中 hide: true + # default value + # 默认值 defaultValue: 6000 # collect metrics config list # 采集指标配置列表 @@ -460,4 +516,4 @@ metrics: oids: hrDeviceIndex: 1.3.6.1.2.1.25.3.2.1.1 hrDeviceDescr: 1.3.6.1.2.1.25.3.2.1.3 - hrDeviceStatus: 1.3.6.1.2.1.25.3.2.1.5 \ No newline at end of file + hrDeviceStatus: 1.3.6.1.2.1.25.3.2.1.5 diff --git a/web-app/src/app/routes/monitor/monitor-edit/monitor-edit.component.html b/web-app/src/app/routes/monitor/monitor-edit/monitor-edit.component.html index 24078cd6518..a626cf3e67c 100644 --- a/web-app/src/app/routes/monitor/monitor-edit/monitor-edit.component.html +++ b/web-app/src/app/routes/monitor/monitor-edit/monitor-edit.component.html @@ -343,8 +343,13 @@ id="collector" [nzCustomTemplate]="collectorTemplate" > - + {{ 'monitor.collector.system.default' | i18n }} + {{ 'collector.mode.public' | i18n }} {{ @@ -352,7 +357,10 @@ }} {{ item.name }} - {{ item.ip }} + {{ item.ip }} + + {{ item.mode == 'private' ? ('collector.mode.private' | i18n) : ('collector.mode.public' | i18n) }} + diff --git a/web-app/src/app/routes/monitor/monitor-new/monitor-new.component.html b/web-app/src/app/routes/monitor/monitor-new/monitor-new.component.html index 98c62505756..6eee6261782 100644 --- a/web-app/src/app/routes/monitor/monitor-new/monitor-new.component.html +++ b/web-app/src/app/routes/monitor/monitor-new/monitor-new.component.html @@ -352,8 +352,13 @@ id="collector" [nzCustomTemplate]="collectorTemplate" > - + {{ 'monitor.collector.system.default' | i18n }} + {{ 'collector.mode.public' | i18n }} {{ @@ -361,7 +366,10 @@ }} {{ item.name }} - {{ item.ip }} + {{ item.ip }} + + {{ item.mode == 'private' ? ('collector.mode.private' | i18n) : ('collector.mode.public' | i18n) }} + diff --git a/web-app/src/app/routes/monitor/monitor-new/monitor-new.component.ts b/web-app/src/app/routes/monitor/monitor-new/monitor-new.component.ts index f935fd6ac83..827aeaa5a85 100644 --- a/web-app/src/app/routes/monitor/monitor-new/monitor-new.component.ts +++ b/web-app/src/app/routes/monitor/monitor-new/monitor-new.component.ts @@ -138,7 +138,10 @@ export class MonitorNewComponent implements OnInit { onHostChange(hostValue: string) { if (this.monitor.app != 'prometheus') { - this.monitor.name = `${this.monitor.app.toUpperCase()}_${hostValue}`; + let autoName = `${this.monitor.app.toUpperCase()}_${hostValue}`; + if (this.monitor.name == undefined || this.monitor.name == '' || this.monitor.name.startsWith(this.monitor.app.toUpperCase())) { + this.monitor.name = autoName; + } } } diff --git a/web-app/src/app/shared/components/help-massage-show/help-massage-show.component.less b/web-app/src/app/shared/components/help-massage-show/help-massage-show.component.less index 8a79836a539..4408c5303bc 100644 --- a/web-app/src/app/shared/components/help-massage-show/help-massage-show.component.less +++ b/web-app/src/app/shared/components/help-massage-show/help-massage-show.component.less @@ -58,7 +58,6 @@ .help_massage_nav { float: left; - border-right: 1px solid white; height: 28.8px; padding-left: 23px; padding-right: 23px;