[inputs.exec] Error in plugin: exec: exit status 1 for command for shell script

I am trying to execute a shell script to get output from database, but I am getting below error. Can someone please advise any solution?

2022-09-19T12:18:00Z E! [inputs.exec] Error in plugin: exec: exit status 1 for command ‘/data/1rd/grafana/scripts/getReconConsumerData.sh’: Traceback (most recent call last):…

Sounds like when trying to execute that script a Traceback is printed out.

Can you run that script on it’s own?
What does the full traceback show?
Are you sure Telegraf has permissions to run that script?

How do I check if Telegraf has permissions to run the script? And how do I enable full traceback?

Kindly do suggest.

How do I check if Telegraf has permissions to run the script?

This is a unix permissions question :slight_smile: and it depends on how you are running Telegraf. Essentially you want to ensure that the user running telegraf has execute permissions on the script you need to run.

For example, if you are launch telegraf manually (e.g. ./telegraf ....) then you would need to also be able to run the script.

And how do I enable full traceback?

It should be printing the full error buffer.

So, i get the below error when i execute ./telegraf.

./telegraf
2022-11-18T07:40:02Z I! Starting Telegraf 1.18.0
2022-11-18T07:40:02Z E! [telegraf] Error running agent: No config file specified, and could not find one in $TELEGRAF_CONFIG_PATH, /home/1rdexe/.telegraf/telegraf.conf, or /etc/telegraf/telegraf.conf

Right you will still need to provide it your config file.