Skip to content

Commit

Permalink
[collector] bugfix npe when snmp walk special fields (#883)
Browse files Browse the repository at this point in the history
* [collector] bugfix npe when snmp walk special fields

* add ArgusDBM link

* [docs] update event doc

* [docs] update ospp event link
  • Loading branch information
tomsun28 authored Apr 17, 2023
1 parent f79972e commit 3d7a305
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -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、团队协作等核心功能
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ public void collect(CollectRep.MetricsData.Builder builder, long appId, String a
Map<String, String> oidsMap = snmpProtocol.getOids();
Map<String, String> 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);
Expand Down Expand Up @@ -160,6 +163,9 @@ public void collect(CollectRep.MetricsData.Builder builder, long appId, String a
VariableBinding[] varBindings = tableEvent.getColumns();
Map<String, String> 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);
Expand All @@ -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)) {
Expand Down
26 changes: 26 additions & 0 deletions home/docs/others/huaweicloud.md
Original file line number Diff line number Diff line change
@@ -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 了解更多。
10 changes: 10 additions & 0 deletions home/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
@@ -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 了解更多。

0 comments on commit 3d7a305

Please sign in to comment.