首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Telegraf无法从Arista MIB中提取路由表信息

Telegraf无法从Arista MIB中提取路由表信息
EN

Stack Overflow用户
提问于 2022-06-11 19:55:55
回答 1查看 101关注 0票数 0

所以我试着从一些阿瑞斯那里收集路由数据。

当我跑来跑去的时候,一切似乎都正常.

ARISTA-FIB-STATS-MIB::aristaFIBStatsTotalRoutesForRouteType ARISTA-FIB-STATS-MIB::aristaFIBStatsTotalRoutesForRouteType.ipv4.other = Gauge32: 3 ARISTA-FIB-STATS-MIB::aristaFIBStatsTotalRoutesForRouteType.ipv4.connected = Gauge32: 8 ARISTA-FIB-STATS-MIB::aristaFIBStatsTotalRoutesForRouteType.ipv4.static =Gauge32 26 ARISTA-FIB-STATS-MIB::aristaFIBStatsTotalRoutesForRouteType.ipv4.ospf = Gauge32: 542 ARISTA-FIB-STATS-MIB::aristaFIBStatsTotalRoutesForRouteType.ipv4.bgp = Gauge32: 1623 ARISTA-FIB-STATS-MIB::aristaFIBStatsTotalRoutesForRouteType.附件= Gauge32: 12 ARISTA-FIB-STATS-MIB::aristaFIBStatsTotalRoutesForRouteType.ipv6.other = Gauge32: 25 ARISTA-FIB-STATS-MIB::aristaFIBStatsTotalRoutesForRouteType.ipv6.other= Gauge32: 3 ARISTA-FIB-STATS-MIB::aristaFIBStatsTotalRoutesForRouteType.ipv6.internal = Gauge32:

但当我试图用telegraf提取数据时,我会得到不同的信息.

BGP,agent_host=10.45.100.20,host=nw01.ny5,hostname=CR.NY aristaFIBStatsTotalRoutesForRouteType=2i 1654976575000000000 BGP,agent_host=10.45.100.20,host=nw01.ny5,hostname=CR.NY aristaFIBStatsTotalRoutes=2260i 1654976575000000000 BGP,agent_host=10.45.100.20,host=nw01.ny5,hostname=CR.NY aristaFIBStatsTotalRoutesForRouteType=8i 16549765750000000 BGP,agent_host=10.45.100.20,host=nw01.ny5,hostname=CR.NY aristaFIBStatsTotalRoutesForRouteType=63i 16549765750000000

根据MIB文件..。

https://www.arista.com/assets/data/docs/MIBS/ARISTA-FIB-STATS-MIB.txt

它使用的是IANA-RTPROTO-MIB.txt协议定义,但我不知道从哪里得到这些信息,因为通过telegraf检索到的数据没有向我显示任何信息。有人知道怎么处理这事吗?

EN

回答 1

Stack Overflow用户

发布于 2022-09-16 08:24:20

首先,您可能希望通过在index_as_tag = true中设置inputs.snmp.table来使telegraf返回返回行的索引。

然后,在配置中添加以下处理器:

代码语言:javascript
复制
# Parse aristaFIBStatsAF and aristaFIBStatsRouteType from index for BGP table
[[processors.regex]]
  namepass = ["BGP"]
  order = 1

  [[processors.regex.tags]]
    ## Tag to change
    key = "index"
    ## Regular expression to match on a tag value
    pattern = "^(\\d+)\\.(\\d+)$"
    replacement = "${1}"
    ## Tag to store the result
    result_key = "aristaFIBStatsAF"

  [[processors.regex.tags]]
    ## Tag to change
    key = "index"
    ## Regular expression to match on a tag value
    pattern = "^(\\d+)\\.(\\d+)$"
    replacement = "${2}"
    ## Tag to store the result
    result_key = "aristaFIBStatsRouteType"


# Rename index to aristaFIBStatsAF for BGP table with single index row
[[processors.rename]]
  namepass = ["BGP"]
  order = 2

  [[processors.rename.replace]]
    tag = "index"
    dest = "aristaFIBStatsAF"

  [processors.rename.tagdrop]
    aristaFIBStatsAF = ["*"]


# Translate tag values for BGP table
[[processors.enum]]
  namepass = ["BGP"]
  order = 3
  tagexclude = ["index"]

  [[processors.enum.mapping]]
    ## Name of the tag to map
    tag = "aristaFIBStatsAF"

    ## Table of mappings
    [processors.enum.mapping.value_mappings]
      0 = "unknown"
      1 = "ipv4"
      2 = "ipv6"

  [[processors.enum.mapping]]
    ## Name of the tag to map
    tag = "aristaFIBStatsRouteType"

    ## Table of mappings
    [processors.enum.mapping.value_mappings]
      1   = "other"
      2   = "connected"
      3   = "static"
      8   = "rip"
      9   = "isIs"
      13  = "ospf"
      14  = "bgp"
      200 = "ospfv3"
      201 = "staticNonPersistent"
      202 = "staticNexthopGroup"
      203 = "attached"
      204 = "vcs"
      205 = "internal"

免责声明:没有在telegraf中测试这个,所以可能有一些错误

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72587485

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档