Set time between plugins

Im trying to setup a performance measurement probe. One of part of it is telegraf running a the ping and exec input. exec input runs a speedtest. The problem is that the ping and exec seem to be running at the same time, which means that the ping result will be higher due to the speedtest. Im looking for a way to make them run after eachother. Or atleast not at the same time. So the results of the ping input is not influenced by the other inputs.

[[inputs.exec]]
commands = ["/usr/bin/speedtest -f json-pretty -s 52365"]
name_override = "Speedtest"
timeout = "1m"
interval = "30m"
data_format = "json"
json_string_fields = [ "interface_externalIp",
                       "server_name",
                       "server_location",
                       "server_host",
                       "server_ip",
                       "result_url" ]

# Ping given url(s) and return statistics
[[inputs.ping]]
  urls = ["nl-ams-as1200.anchors.atlas.ripe.net","cdn.17app.co.akamaized.net"]
  # method = "exec".
  count = 10
  interval =  30
  # ping_interval = 10.0
  # timeout = 1.0
  # deadline = 10.
  # interface = ""
  # percentiles = [50, 95, 99]
  # binary = "ping"
  # arguments = ["-c", "3"]
  # ipv6 = false.
  # size = 56

# Query given DNS server and gives statistics
[[inputs.dns_query]]
  servers = ["192.168.1.1"]
  # network = "udp"
   domains = ["google.nl","nu.nl"]
  # record_type = "A"
  # port = 53
  # timeout = "2s"
  interval = "3m"

# HTTP/HTTPS request given an address a method and a timeout
[[inputs.http_response]]
   urls = ["https://google.nl","https://nu.nl.nl"]
  # response_timeout = "5s"
   method = "GET"
  follow_redirects = true
  interval = "3m"

Hello @svenvg93,
Welcome!
Telegraf executes input plugins based on the order they appear in the configuration file. If you have multiple input plugins and wish to prioritize some over others, you can order them accordingly in the config file.

There isnt a way to introduce delays or depends on. However you could do that with multiple agents in docker for example.

1 Like

Would setting a collection offset for one of the plugins work for you? See: telegraf/docs/CONFIGURATION.md at master · influxdata/telegraf · GitHub. You could delay the ping by 1 minute for example.

1 Like

Will give it a shot and report back

Thanks for the suggestion :slight_smile:
I give the speedtest the a collection_offset = “2m” to make it run over 2 minutes after the hour. This way it runs during the interval of all the all tests. Thanks for all the help!

1 Like