Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

아래는 SNMP에 대한 CH Collector(Telegraf)예시이며, 적절한 IP 혹은 도메인으로 바꿔서 사용해야 합니다.

자세한 사용법은 Telegraf 공식 가이드: SNMP를 참조합니다.
IF-MIB 정보: https://mibs.observium.org/mib/IF-MIB/
전체 MIB 데이터베이스: https://mibs.observium.org/

Code Block
languagepybash
[agent]
  [inputs.snmp]]
agents = [ "10.10.250.2:161" ]
interval = "1m"
timeout =  round_interval"15s"
retries = true
  metric_batch_size3
version = 10002
community = metric_buffer_limit"S2F_Center_RO"
max_repetitions = 100003
name = collection_jitter = "0s"
  flush_interval"snmp_nx"

  [[inputs.snmp.field]]
  oid = "10sRFC1213-MIB::sysUpTime.0"
  flush_jittername = "0suptime"

 precision = ""
  debug = false
  quiet = false
  logfile = "/var/log/telegraf/telegraf.log"
  hostname = "network_router01"
  omit_hostname = false

[[outputs.influxdb]]
  urls = ["http://influxdb:8086"]
  database = "telegraf"
  username = ""
  password = ""
  retention_policy = ""  
  write_consistency = "any"
  timeout = "10s"

[[inputs.system]]

[[inputs.snmp]]
  agents = [ "211.xxx.xxx.254:161"]
  ## Timeout for each SNMP query.
  timeout = "3s"
  ## Number of retries to attempt within timeout.
  retries = 3
  ## SNMP version, values can be 1, 2, or 3
  version = 2

  ## SNMP community string.
  community = "xperttop0!"

  ## The GETBULK max-repetitions parameter
  max_repetitions = 3
  ## measurement name # oid에 없는 장비도 있으니, 확인 필요
  [[inputs.snmp.field]]
  name = "cpu_utilization"
  oid = ".1.3.6.1.4.1.9.9.109.1.1.1.1.5.1"
  [[inputs.snmp.field]]
  name = "mem_utilization"
  oid = ".1.3.6.1.4.1.9.9.48.1.1.1.5.16"
  
  [[inputs.snmp.field]]
  name = "cpu_5sec"
  oid = "SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.6.19"

  [[inputs.snmp.field]]
  name = "cpu_1min"
  oid = "SNMPv2-SMI::enterprises.9.9.109.1.1.1.1.7.19"

  [[inputs.snmp.field]]
  name = "mem_used"
  oid = "SNMPv2-SMI::enterprises.9.9.48.1.1.1.5.1"

  [[inputs.snmp.field]]
  name = "mem_free"
  oid = "SNMPv2-SMI::enterprises.9.9.48.1.1.1.6.1"

  [[inputs.snmp.table]]
  oid = "IF-MIB::ifTable"
  name = "snmp_nx"
  inherit_tags = [ "source" ]

    [[inputs.snmp.table.field]]
    # 32bit counter
    oid = "IF-MIB::ifIndex"
    name = "ifIndex"
    is_tag = true

    [[inputs.snmp.table.field]]
    oid = "IF-MIB::ifDescr"
    name = "ifDescr"
    is_tag = true

    [[inputs.snmp.table.field]]
    oid = "IF-MIB::ifName"
    name = "ifName"
    is_tag = true

    [[inputs.snmp.table.field]]
    oid = "IF-MIB::ifAlias"
    name = "snmp"ifAlias"
    is_tag = true

  [[inputs.snmp.fieldtable]]
  # 64bit counter
  oid = "IF-MIB::ifXTable"
  name = "cpusnmp_utilizationnx"
  oidinherit_tags = ".1.3.6.1.4.1.9.9.109.1.1.1.1.5.1"
 [ "source" ]

    [[inputs.snmp.table.field]]
    nameoid = "mem_utilization"IF-MIB::ifIndex"
    oidname = ".1.3.6.1.4.1.9.9.48.1.1.1.5.16"

# 아래 snmp-ifTable과 snmp-ifXTable 중 하나 사용.ifIndex"
    is_tag = true

    [[inputs.snmp.table.field]]
    oid = "IF-MIB::ifDescr"
    name = "ifDescr"snmp-ifTable"
    is_tag = true

    [[inputs.snmp.table.field]]
    oid = "IF-MIB::ifTable"ifName"
    name = "ifName"
    indexis_as_tag = true

    [[inputs.snmp.table.field]]
    nameoid = "snmp-ifXTableIF-MIB::ifAlias"
  oid  name ="IF-MIB::ifXTable" "ifAlias"
    index_asis_tag = true