Input.exec not running bash script


Hi, I deployed tick stack in docker. I configured telegraf.conf file to take some metrics from [[input.exec plugin]]. Here is my bash script
cat /proc/uptime | perl -ne ‘/(\d*)/ ; printf “%02d:%02d:%02d:%02d\n”,int($1/86400),int(($1%86400)/3600),int(($1%3600)/60),$1%60’

It is running from terminal but not from telegraf.
please help me to solve this issue


hi @pbsopankar welcome ,

it can be a permission problem ,
can you run the script with the telegraf user ?

best regards ,


yeah the script runs with telegraf user. But not from telegraf.conf it is giving an error

2019-05-10T13:54:08Z E! [inputs.influxdb]: Error in plugin: [url=]: Get dial tcp connect: no route to host
2019-05-10T13:54:05Z E! [inputs.exec]: Error in plugin: metric parse error: expected tag at 1:12: “00:08:27:13”


This is my telegraf.conf file


## Commands array

commands = [“sh /etc/telegraf/”]

## Timeout for each command to complete.

timeout = “5s”

## measurement name suffix (for separating different commands)

name_suffix = “_mycollector”

## Data format to consume.

## Each data format has its own unique set of configuration options, read

## more about them here:


data_format = “influx”


Hi @pbsopankar ,

the bash script should return the output in the line protocol format …

the error : metric parse error: expected tag at 1:12: “00:08:27:13” tells that the format of the output
is not ok.