From 5a6f53e24007165759546ad7eb339d3ec649baa5 Mon Sep 17 00:00:00 2001 From: tomsun28 Date: Mon, 17 Apr 2023 11:43:32 +0800 Subject: [PATCH] [collector] bugfix npe when snmp walk special fields (#883) [collector] bugfix npe when snmp walk special fields add ArgusDBM link [docs] update event doc [docs] update ospp event link --- README.md | 1 + README_CN.md | 1 + .../collect/snmp/SnmpCollectImpl.java | 10 +++++++ home/docs/others/huaweicloud.md | 26 +++++++++++++++++++ home/docusaurus.config.js | 10 +++++++ .../current/others/huaweicloud.md | 26 +++++++++++++++++++ 6 files changed, 74 insertions(+) create mode 100644 home/docs/others/huaweicloud.md create mode 100644 home/i18n/zh-cn/docusaurus-plugin-content-docs/current/others/huaweicloud.md diff --git a/README.md b/README.md index cdcb91da1a9..5f1465f4db5 100644 --- a/README.md +++ b/README.md @@ -313,6 +313,7 @@ HertzBeat is a project under the [Dromara Open Source Community](https://dromara - [DynamicTp](https://github.com/dromara/dynamic-tp) : 轻量级动态线程池,内置监控告警功能,集成三方中间件线程池管理,基于主流配置中心 - [Hippo4j](https://github.com/opengoofy/hippo4j/) : 强大的动态线程池框架,附带监控报警功能 - [Jpom](https://gitee.com/dromara/Jpom) : 简而轻的低侵入式在线构建、自动部署、日常运维、项目监控软件 +- [ArgusDBM](https://github.com/zmops/ArgusDBM) : 开源数据库一体化监控平台,致力于监控所有数据库 ##### Sponsor diff --git a/README_CN.md b/README_CN.md index 13464c25697..a94ba062c79 100644 --- a/README_CN.md +++ b/README_CN.md @@ -318,6 +318,7 @@ HertzBeat 赫兹跳动是 [Dromara开源社区](https://dromara.org/) 下项目 - [DynamicTp](https://github.com/dromara/dynamic-tp) : 轻量级动态线程池,内置监控告警功能,集成三方中间件线程池管理,基于主流配置中心 - [Hippo4j](https://github.com/opengoofy/hippo4j/) : 强大的动态线程池框架,附带监控报警功能 - [Jpom](https://gitee.com/dromara/Jpom) : 简而轻的低侵入式在线构建、自动部署、日常运维、项目监控软件 +- [ArgusDBM](https://github.com/zmops/ArgusDBM) : 开源数据库一体化监控平台,致力于监控所有数据库 ##### 赞助 - Postcat [开源 API 管理工具 ](https://datayi.cn/w/xRxVBBko) 简单可拓展,支持 API 测试、文档、Mock、团队协作等核心功能 diff --git a/collector/src/main/java/org/dromara/hertzbeat/collector/collect/snmp/SnmpCollectImpl.java b/collector/src/main/java/org/dromara/hertzbeat/collector/collect/snmp/SnmpCollectImpl.java index 504d2590d1b..8b7746dcfe4 100644 --- a/collector/src/main/java/org/dromara/hertzbeat/collector/collect/snmp/SnmpCollectImpl.java +++ b/collector/src/main/java/org/dromara/hertzbeat/collector/collect/snmp/SnmpCollectImpl.java @@ -122,6 +122,9 @@ public void collect(CollectRep.MetricsData.Builder builder, long appId, String a Map oidsMap = snmpProtocol.getOids(); Map oidsValueMap = new HashMap<>(oidsMap.size()); for (VariableBinding binding : vbs) { + if (binding == null) { + continue; + } Variable variable = binding.getVariable(); if (variable instanceof TimeTicks) { String value = ((TimeTicks) variable).toString(FORMAT_PATTERN); @@ -160,6 +163,9 @@ public void collect(CollectRep.MetricsData.Builder builder, long appId, String a VariableBinding[] varBindings = tableEvent.getColumns(); Map oidsValueMap = new HashMap<>(varBindings.length); for (VariableBinding binding : varBindings) { + if (binding == null) { + continue; + } Variable variable = binding.getVariable(); if (variable instanceof TimeTicks) { String value = ((TimeTicks) variable).toString(FORMAT_PATTERN); @@ -168,6 +174,10 @@ public void collect(CollectRep.MetricsData.Builder builder, long appId, String a oidsValueMap.put(binding.getOid().trim().toDottedString(), bingdingHexValueToString(binding)); } } + // when too many empty value field, ignore + if (oidsValueMap.size() < metrics.getAliasFields().size() / 2) { + continue; + } CollectRep.ValueRow.Builder valueRowBuilder = CollectRep.ValueRow.newBuilder(); for (String alias : metrics.getAliasFields()) { if (CollectorConstants.RESPONSE_TIME.equalsIgnoreCase(alias)) { diff --git a/home/docs/others/huaweicloud.md b/home/docs/others/huaweicloud.md new file mode 100644 index 00000000000..c6433ac6cf6 --- /dev/null +++ b/home/docs/others/huaweicloud.md @@ -0,0 +1,26 @@ +--- +id: huaweicloud +title: HertzBeat & HuaweiCloud +sidebar_label: HertzBeat & HuaweiCloud +--- + +### HertzBeat 与 HuaweiCloud 的开源合作需求Issue + +> 欢迎大家对感兴趣的Issue领取贡献。 + +- [Task] support using Huawei Cloud OBS to store custom define yml file [#841](https://github.com/dromara/hertzbeat/issues/841) +- [Task] support Huawei Cloud CCE metrics monitoring [#839](https://github.com/dromara/hertzbeat/issues/839) +- [Task] support EulerOS metrics monitoring [#838](https://github.com/dromara/hertzbeat/issues/838) +- [Task] support using Huawei Cloud SMN send alarm notification message [#837](https://github.com/dromara/hertzbeat/issues/837) +- [Task] support using GaussDB For Influx store history metrics data [#836](https://github.com/dromara/hertzbeat/issues/836) + + + + +### 关于 HuaweiCloud 开源活动 + +HuaweiCloud 华为云将面向开源软件工具链与环境、开源应用构建和开源生态组件构建这三大重点场景,提供技术支持、奖金支持、活动支持,邀请更多的开发者,携手构建开源for HuaweiCloud。 + +开发者将开源软件工具、开源应用和开源组件与华为云对象存储OBS、数仓DWS、云容器CCE等云服务对接,同时基于Terraform模板,上架到华为云云商店,支持其他开发者一键部署使用开源组件 ,称为“开源xxx for HuaweiCloud”。 + +感兴趣的开发者可以查看:华为云开源项目仓库 https://gitee.com/HuaweiCloudDeveloper/huaweicloud-cloud-native-plugins-kits 了解更多。 diff --git a/home/docusaurus.config.js b/home/docusaurus.config.js index 7058902b85b..617c0e786d4 100644 --- a/home/docusaurus.config.js +++ b/home/docusaurus.config.js @@ -91,6 +91,16 @@ module.exports = { position: 'left', to: 'docs/others/developer', }, + { + label: '开源之夏', + position: 'left', + href: 'https://summer-ospp.ac.cn/org/orgdetail/bef415f7-741e-4db8-a4ff-b3904c502471', + }, + { + label: '华为云开源活动', + position: 'left', + to: 'docs/others/huaweicloud', + }, { label: 'enterprise', position: 'left', diff --git a/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/others/huaweicloud.md b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/others/huaweicloud.md new file mode 100644 index 00000000000..c6433ac6cf6 --- /dev/null +++ b/home/i18n/zh-cn/docusaurus-plugin-content-docs/current/others/huaweicloud.md @@ -0,0 +1,26 @@ +--- +id: huaweicloud +title: HertzBeat & HuaweiCloud +sidebar_label: HertzBeat & HuaweiCloud +--- + +### HertzBeat 与 HuaweiCloud 的开源合作需求Issue + +> 欢迎大家对感兴趣的Issue领取贡献。 + +- [Task] support using Huawei Cloud OBS to store custom define yml file [#841](https://github.com/dromara/hertzbeat/issues/841) +- [Task] support Huawei Cloud CCE metrics monitoring [#839](https://github.com/dromara/hertzbeat/issues/839) +- [Task] support EulerOS metrics monitoring [#838](https://github.com/dromara/hertzbeat/issues/838) +- [Task] support using Huawei Cloud SMN send alarm notification message [#837](https://github.com/dromara/hertzbeat/issues/837) +- [Task] support using GaussDB For Influx store history metrics data [#836](https://github.com/dromara/hertzbeat/issues/836) + + + + +### 关于 HuaweiCloud 开源活动 + +HuaweiCloud 华为云将面向开源软件工具链与环境、开源应用构建和开源生态组件构建这三大重点场景,提供技术支持、奖金支持、活动支持,邀请更多的开发者,携手构建开源for HuaweiCloud。 + +开发者将开源软件工具、开源应用和开源组件与华为云对象存储OBS、数仓DWS、云容器CCE等云服务对接,同时基于Terraform模板,上架到华为云云商店,支持其他开发者一键部署使用开源组件 ,称为“开源xxx for HuaweiCloud”。 + +感兴趣的开发者可以查看:华为云开源项目仓库 https://gitee.com/HuaweiCloudDeveloper/huaweicloud-cloud-native-plugins-kits 了解更多。