0

I am trying to configure telegraf to run bash script with a flag.

For example:

[[inputs.exec]] ## Commands array
  commands = [ 
    "/tmp/test.sh", 
  ]

That works fine, but when I modify it to:

[[inputs.exec]] 
  ## Commands array 
  commands = [ 
    "/tmp/test.sh -r", 
  ]

It looks like telegraf is ignoring the '-r' flag.

What is wrong?

Saine1991
  • 1
  • 4

1 Answers1

0

I would do it like this:

  commands = [
 "/bin/bash -c '/tmp/test.sh -r'"
]

Best.

G Bourque
  • 39
  • 3