nightingale
nightingale copied to clipboard
前端无法读取指snmp指标数据,但可以显示自动提示
categraf部署在n9e主机中,在categraf中可以获取snmp数据,但在前端无法获取数据,promql也可以自动提示index,可以如何判断问题所在呢?
- 上下两张图的截图没有对应上,信息量不够
- Categraf的配置文件,最好贴出来
- 下面查询不到数据的截图全面一点
- 上下两张图的截图没有对应上,信息量不够
- Categraf的配置文件,最好贴出来
- 下面查询不到数据的截图全面一点
配置文件如下:
interval = "10s"
[mappings]
"udp://172.20.189.81:161" = {name = "AP08A36U81", region = "bj", role = "poe", floor = "8", u = "A36"}
省略一些主机
[[instances]]
agents = [
"udp://172.20.189.81:161",
...
]
interval_times = 1
## config for each request.
timeout = "5s"
version = 2
community = "snmp"
agent_host_tag = "ip"
retries = 3
max_repetitions = 50
[[instances.table]]
oid = "IF-MIB::ifTable"
name = "interface"
index_as_tag = true
filters = ["A:ifDescr:^(10GE*|GE*|Eth-Trunk*)"]
filters_expression = "A"
# 描述
[[instances.table.field]]
oid = "IF-MIB::ifDescr"
name = "ifDescr"
is_tag = true
# 流入流量
[[instances.table.field]]
oid = "IF-MIB::ifHCInOctets"
name = "ifHCInOctets"
...
[[instances]]
agents = [
"udp://172.20.189.81:161",
...
]
interval_times = 3
## config for each request.
timeout = "5s"
version = 2
community = "snmp"
agent_host_tag = "ip"
retries = 3
max_repetitions = 50
# 光模块
[[instances.table]]
oid = "HUAWEI-ENTITY-EXTENT-MIB::hwOpticalModuleInfoTable"
name = "optical"
index_as_tag = true
filters = ["B:hwEntityOpticalPortName:^(10GE*|GE*)", "C:hwEntityOpticalWaveLength:1310"]
filters_expression = "C&&B"
# 端口名称
[[instances.table.field]]
oid = "HUAWEI-ENTITY-EXTENT-MIB::hwEntityOpticalPortName"
name = "hwEntityOpticalPortName"
is_tag = true
# 波长
[[instances.table.field]]
oid = "HUAWEI-ENTITY-EXTENT-MIB::hwEntityOpticalWaveLength"
name = "hwEntityOpticalWaveLength"
...
[[instances]]
agents = [
"udp://172.20.189.81:161",
...
]
interval_times = 216
## config for each request.
timeout = "5s"
version = 2
community = "snmp"
agent_host_tag = "ip"
retries = 3
max_repetitions = 50
[[instances.table]]
# 此处是重复的instances.table,但是采集周期不同,所以是一个空表
name = "optical"
index_as_tag = true
[[instances.table.field]]
oid = "HUAWEI-ENTITY-EXTENT-MIB::hwEntityOpticalRxLowThreshold"
name = "hwEntityOpticalRxLowThreshold"
[[instances.table.field]]
oid = "HUAWEI-ENTITY-EXTENT-MIB::hwEntityOpticalRxHighThreshold"
name = "hwEntityOpticalRxHighThreshold"
通过 -test,可以获取到数据:
但前端没有数据:
是因为多个[[instances]]和interval_times造成的吗?
update一下,从图中好像是因为数据采集中断造成的,获取一些就会中断几分钟,interval写的是10s啊~这是为什么呢?
数据采集不符合预期可以提issue到 github.com/flashcatcloud/categraf 。interval_times确实会影响采集频率,interval的值乘以interval_times是最终的采集频率,categraf的文档里有写
github.com/flashcatcloud/categraf 提交