我尝试配置 bosun scollector,我得到 snmpwalk 使用整数格式输出,但是当我尝试使用 cpu 获取一些输出时,输出时它是字符串格式。
示例:
.1.3.6.1.4.1.2620.1.48.23.1.4.1.0 = INTEGER: 23
--- 工作
.1.3.6.1.4.1.2620.1.48.29.1.2.2.0 = STRING: "1%"
--- 不工作
这是配置:
Host = "http://localhost:8070"
DisableSelf = true
Freq = 60
Filter = ["snmp-generic", "snmp-ifaces"]
[[SNMP]]
Community = "test"
Host = "name"
MIBs = [ "fwname"]
[Tags]
product = "fw"
[MIBs]
[MIBs.fw]
BaseOid = ".1.3.6.1.4.1.2620"
[[MIBs.fw.Metrics]]
Metric = "os.cpu"
Oid = ".1.6.7.2.4.0"
Unit = "percent"
RateType = "gauge"
[[MIBs.fw.Metrics]]
Metric = "os.cpu.used"
Oid = ".1.6.7.4.5.0"
Unit = "percent"
RateType = "gauge"
这是错误信息:
2016/12/01 21:37:08 error: interval.go:64: snmp-generic-fw strconv.ParseFloat: parsing "0%": invalid syntax
我知道这是字符串格式问题,但知道如何修复它支持字符串
谢谢你所有的帮助