-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtelegraf.conf
98 lines (80 loc) · 2.81 KB
/
telegraf.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# TODO
# How should this work, should it be a template and
# there are scripts that create it? for now I'll just write out
# something that works and I'll figure out other stuff later
# how do I add tags
# what more snmp fields do I want to add
# started from config from https://blog.networktocode.com/post/network_telemetry_for_snmp_devices/
[[inputs.snmp]]
agents = ['udp://127.0.0.1:3301', 'udp://127.0.0.1:3302']
version = 2
community = 'public'
interval = "15s"
timeout = "3s"
retries = 2
[[inputs.snmp.field]]
name = "hostname"
oid = ".1.3.6.1.2.1.1.5.0"
is_tag = true
[[inputs.snmp.field]]
name = "uptime"
oid = "1.3.6.1.2.1.1.3.0"
[[inputs.snmp.field]]
name = "sysName"
oid = "SNMPv2-MIB::sysName.0"
is_tag = true
[[inputs.snmp.field]]
name = "sysUpTime"
oid = "SNMPv2-MIB::sysUpTime.0"
#####################################################
#
# Gather Interface Statistics via SNMP
#
#####################################################
# IF-MIB::ifTable contains counters on input and output traffic as well as errors and discards.
[[inputs.snmp.table]]
name = "interface"
inherit_tags = [ "hostname" ]
oid = "IF-MIB::ifTable"
# Interface tag - used to identify interface in metrics database
[[inputs.snmp.table.field]]
name = "name"
oid = "IF-MIB::ifDescr"
is_tag = true
# IF-MIB::ifXTable contains newer High Capacity (HC) counters that do not overflow as fast for a few of the ifTable counters
[[inputs.snmp.table]]
name = "interface"
inherit_tags = [ "hostname" ]
oid = "IF-MIB::ifXTable"
# Interface tag - used to identify interface in metrics database
[[inputs.snmp.table.field]]
name = "name"
oid = "IF-MIB::ifDescr"
is_tag = true
# EtherLike-MIB::dot3StatsTable contains detailed ethernet-level information about what kind of errors have been logged on an interface (such as FCS error, frame too long, etc)
[[inputs.snmp.table]]
name = "interface"
inherit_tags = [ "hostname" ]
oid = "EtherLike-MIB::dot3StatsTable"
# Interface tag - used to identify interface in metrics database
[[inputs.snmp.table.field]]
name = "name"
oid = "IF-MIB::ifDescr"
is_tag = true
[[inputs.snmp.table]]
name = "interface"
inherit_tags = [ "hostname"]
oid = "JUNIPER-IF-MIB::ifJnxTable"
# Interface tag - used to identify interface in metrics database
[[inputs.snmp.table.field]]
name = "name"
oid = "IF-MIB::ifDescr"
is_tag = true
#####################################################
#
# Export SNMP Information to Prometheus
#
#####################################################
[[outputs.prometheus_client]]
listen = ":9012"
metric_version = 2