I am currently writing a script to manage Telegraf config generation for a number of SNMP devices and I’m trying to decide the best way to lay out my config.
My first thought is that a single monolithic file is bad, mostly for readability issues. This then leaves me with the issue of deciding how to break it up.
In my current non-automated config I have a separate config file for each device type that I am trying to collect data from, which may look like this:
[[inputs.snmp]] agents = ["device1","device2","device3"] version = 1 community = "private" name = "device_type" [[inputs.snmp.field]] name = "oid_name" oid = "some::oid"
Going forwards my plan is to create a separate file for each device, such that only a single device would exist for each agent field. This seems fairly clean to me, except when I look how Telegraf appears to load plugins - every time I invoke a plugin I see it get loaded in the log file.
This makes me think that the layout for my Telegraf config files that I am planning on moving to will generate a bunch of unnecessary overhead. I believe that this shouldn’t be an issue with what we are doing now, but I would hate to introduce any sort of bottleneck that could cause issues down the line.