Add telegraf.conf

This commit is contained in:
2025-12-02 16:42:51 +00:00
parent 0ccfdb22ad
commit 53b35b4c3d

104
telegraf.conf Normal file
View File

@@ -0,0 +1,104 @@
# Global tags (optional)
[global_tags]
env = "lab"
[agent]
interval = "10s"
round_interval = true
metric_batch_size = 1000
metric_buffer_limit = 10000
collection_jitter = "0s"
flush_interval = "10s"
flush_jitter = "0s"
precision = ""
debug = false
omit_hostname = false
###############################################################################
# OUTPUTS
###############################################################################
[[outputs.influxdb]]
urls = ["http://influxdb:8086"]
database = "telegraf"
username = "telegraf"
password = "telegrafpass"
retention_policy = ""
write_consistency = "any"
timeout = "5s"
###############################################################################
# INPUT: Timed pings (latency)
###############################################################################
[[inputs.ping]]
## Targets you want to monitor adjust these to your gear
urls = [
"172.0.0.196",
"172.0.0.197",
"172.0.0.198",
"172.0.0.199",
"8.8.8.8",
"google.com"
]
## How many echo requests per collection interval
count = 4
## How often to send the pings *within* each collection
ping_interval = 1.0
## Per-ping timeout in seconds
timeout = 1.0
## Use native ping (requires NET_RAW capability)
method = "native"
privileged = true
## Optional: tag name for the target URL/IP
# ip_ttl = 64
###############################################################################
# INPUT: SNMP polling
###############################################################################
[[inputs.snmp]]
## Devices you want SNMP from
agents = [
"udp://172.0.0.1:161",
"udp://172.0.0.199:161"
]
## SNMP version & community
version = 2
community = "moni"
## Base measurement name
name = "snmp"
## Simple single OID (device uptime)
[[inputs.snmp.field]]
name = "sysUpTime"
oid = "1.3.6.1.2.1.1.3.0"
## Interface table traffic per interface
[[inputs.snmp.table]]
name = "ifTable"
inherit_tags = ["agent"]
oid = "1.3.6.1.2.1.2.2"
# Interface description as tag (e.g., "eth0", "wlan0")
[[inputs.snmp.table.field]]
name = "ifDescr"
oid = "1.3.6.1.2.1.2.2.1.2"
is_tag = true
# Inbound octets
[[inputs.snmp.table.field]]
name = "ifInOctets"
oid = "1.3.6.1.2.1.2.2.1.10"
# Outbound octets
[[inputs.snmp.table.field]]
name = "ifOutOctets"
oid = "1.3.6.1.2.1.2.2.1.16"