[root@localhost categraf]# ./categraf -test --inputs snmp
2023/04/11 15:55:54 I! tracing disabled
2023/04/11 15:55:54 main.go:128: I! runner.binarydir: /opt/categraf
2023/04/11 15:55:54 main.go:129: I! runner.hostname: localhost.localdomain
2023/04/11 15:55:54 main.go:130: I! runner.fd_limits: (soft=524288, hard=524288)
2023/04/11 15:55:54 main.go:131: I! runner.vm_limits: (soft=unlimited, hard=unlimited)
2023/04/11 15:55:54 provider.go:69: I! use input provider: [local]
2023/04/11 15:55:54 traces_agent.go:19: I! traces agent disabled!
2023/04/11 15:55:54 prometheus_agent.go:19: I! prometheus scraping disabled!
2023/04/11 15:55:54 ibex_agent.go:19: I! ibex agent disabled!
2023/04/11 15:55:54 agent.go:39: I! agent starting
2023/04/11 15:55:54 metrics_agent.go:190: E! failed to init input: local.snmp error: initializing table interface ins: translating: exec: "snmptranslate": executable file not found in $PATH
2023/04/11 15:55:54 agent.go:47: I! [*agent.MetricsAgent] started
2023/04/11 15:55:54 agent.go:50: I! agent started
##############以下为snmp配置#####################
interval = 60
[[instances]]
agents = ["udp://192.168.10.254:161"]
interval_times = 1
timeout = "5s"
version = 2
community = "public"
agent_host_tag = "ident"
retries = 1
[[instances.field]]
oid = "RFC1213-MIB::sysUpTime.0"
name = "uptime"
[[instances.field]]
oid = "RFC1213-MIB::sysName.0"
name = "source"
is_tag = true
[[instances.table]]
oid = "IF-MIB::ifTable"
name = "interface"
inherit_tags = ["source"]
[[instances.table.field]]
oid = "IF-MIB::ifDescr"
name = "ifDescr"
is_tag = true