#---------------------64位完整配置
[agent]
#https://docs.influxdata.com/telegraf/v1.16/administration/configuration/#agent-configuration
interval = "60s" #60s采集一次
flush_interval = "60s" #60spull一次暴露在路径上
round_interval = true
metric_batch_size = 100000
metric_buffer_limit = 10000
collection_jitter = "0s"
flush_jitter = "0s"
precision = ""
hostname = "ip"
omit_hostname = false
[global_tags]
TPNG = "局部标签"
[[inputs.cpu]]
percpu = true
totalcpu = true
collect_cpu_time = false
report_active = true
[[inputs.disk]]
ignore_fs = ["tmpfs", "devtmpfs", "devfs", "iso9660", "overlay", "aufs", "squashfs"]
[[inputs.diskio]]
[[inputs.kernel]]
[[inputs.mem]]
[[inputs.processes]]
[[inputs.system]]
fielddrop = ["uptime_format"]
[[inputs.net]]
ignore_protocol_stats = true
[[inputs.net]]
[[outputs.prometheus_client]]
# https://github.com/influxdata/telegraf/blob/master/plugins/outputs/prometheus_client/README.md
## Address to listen on.
listen = ":9273"
metric_version = 2
path="/metrics"
string_as_label = true
export_timestamp = true
[[inputs.snmp]]
agents = [
"ip:port"
]
version = 2
community = "团体名"
agent_host_tag = "ident"
[[inputs.snmp.field]] #指标huawei交换机具体名称表头
name = "hostname"
oid = "SNMPv2-MIB::sysName.0"
is_tag = true #作为标签使用
[[inputs.snmp.table]] #针对要采集的对象为ifXTable表
name = "interface" #任意命名指定采集对象的搜索前缀lable
inherit_tags = [ "hostname" ] #代理主机标签即要从顶级配置继承哪些标记并在输出中使用这些标记
oid = "IF-MIB::ifXTable" #需要采集的指标lable
[[inputs.snmp.table.field]] #指标内容:端口作为标签使
name = "ifDescr" #任意命名为:ifDeser
oid = "IF-MIB::ifName" #指标ID
is_tag = true #命名的此标签是否使用/是/否
[inputs.snmp.tags] #定义插件标签
addr = "局部标签"
#[[inputs.exec]]
#commands = ["/tmp/test.sh"]
#timeout = "5m"
#data_format = "influx"
#name_suffix = "_mycollector"