Telegraf collection of data

Hello everyone
I have a problem according to a project I am working on.
I have to collect data from 3000 devices. To get only the data I need I use OID from a MIB file.
Problem: I need to collect data every second, but I can’t. No matter what I try, it seems like there is always the same problem. Note, I have more than 30 measurements in the telegraf.conf file.

Can you please help me with a solution for this problem?

Hi @keida In order to help with this we’ll need some more information on what you’re doing and how you’re doing it.

We can start with the relevant sections of your telegraf.conf file – or ideally the whole thing, scrubbed of any sensitive information like usernames and passwords – so that we can see what you’re collecting and how.

Thanks!
dg

Hello David,
Thank you for your reply and I am sorry for my late response.

I’m creating measurements like this:

[[inputs.snmp]]
agents = [ “xxx.xx.xx.xx:161” ]
timeout = “1000s”
max_repetitions = 10
retries = 1
version = 2
community = “public”
name = “--------------l”

[[inputs.snmp.field]]
  name = "XXXXXXXXXXXX"
  oid = "1.3.6..................2.2.9.4.7.1.3.7.1.3.100"
[[inputs.snmp.field]]
  name = "XXXXXXXXXXXX"
  oid = "1.3.6..................2.2.9.4.7.1.3.7.1.3.111"	
[[inputs.snmp.field]]
  name = "XXXXXXXXXXXX"
  oid = "1.3.6..................2.2.9.4.7.1.3.7.1.3.200"	
[[inputs.snmp.field]]
  name = "XXXXXXXXXXXX"
  oid = "1.3.6..................2.2.9.4.7.1.3.7.1.3.300"
[[inputs.snmp.field]]
  name = "XXXXXXXXXXXX"
  oid = "1.3.6..................2.2.9.4.7.1.3.7.1.3.400"
[[inputs.snmp.field]]
  name = "XXXXXXXXXXXX"
  oid = "1.3.6..................2.2.9.4.7.1.3.7.1.3.500"

I have to add 25+ measurements to Telegraf, but once I do that, I start receiving data very slow. It takes more than 2 min to get some data. Sometimes it also creates bigger problems and I can’t receive any.
It is mandatory for me to collect data with high precision, at least I have to collect data every sec, but less is preferable.
I’ve tried to create different telegraf.conf files, and put them to telegraf.d directory. I created individual services for each one of it, but still I couldn’t receive data as fast as I wanted.

If there is a solution for my problem, please let me know.
Thanks in advance.

You may be able to get better performance by using a table, this will switch the plugin from using GET (snmpget) to GETBULK (snmpbulkwalk).

I don’t have this MIB so I can’t test, but it should be something similar to:

[[inputs.snmp]]
  # Increasing this may help if the table is expected to have many entries
  max_repetitions = 10

  [[inputs.snmp.table]]
    [[inputs.snmp.table.field]]
      name = "XXXXXXXXXXXX"
      oid = "1.3.6..................2.2.9.4.7.1.3.7.1.3.100"
    [[inputs.snmp.table.field]]
      name = "XXXXXXXXXXXX"
      oid = "1.3.6..................2.2.9.4.7.1.3.7.1.3.111"

When I do this, there is no measurement created in my database.
Even when I test it with telegraf -test there is no output. It doesn’t seem to work.

You may need to add a table oid setting.

[[inputs.snmp]]
  [[inputs.snmp.table]]
    oid = "1.3.6..................2.2.9.4.7.1.3.7.1"
    [[inputs.snmp.table.field]]
      oid = "1.3.6..................2.2.9.4.7.1.3.7.1.3.100"

Sorry, these numbers are probably wrong too, I’m just guessing what they might be as I don’t know the actual structure of the MIB here. If you still have issues let me know what the full OID is and perhaps I will be able to look it up online.

I get some problems when I apply this to my telegraf.conf file.
Result is: “2018-10-08T07:44:11Z E! initializing table : getting table columns: exit status 1: Was that a table? SNMPv2-SMI::enterprises.27530.1.1.2.2.9.4.7.0”

I’m unable to find any MIBs for this enterprise online so I don’t think I can help. The basic idea though is to put the table OID so it can be walked, which is more efficient than having the items as top level fields which have to be grabbed one at a time.

You might want to try experimenting with this table example to see how it works with a known MIB.