Inputs.exec failing

Trying to run the following in inputs.exec:

[[inputs.exec]]

[[inputs.exec]]
interval = “60s”
commands = [
“/usr/local/bin/python3.7 /usr/local/telegraf/ucs_traffic_monitor.py /usr/local/telegraf/ucs_domains.txt influxdb-lp -vv”,
]
timeout = “50s”
data_format = “influx”

Get the following error in the log:

[inputs.exec] Error in plugin: exec: exit status 1 for command ‘/usr/local/bin/python3.7 /usr/local/telegraf/ucs_traffic_monitor.py /usr/local/telegraf/ucs_domains.txt influxdb-lp -vv’: Traceback (most recent call last):…

This traceback is from your python application. I would see what it is referring to and it may lead you to what is failing. If you cannot see the full output, I would try running the same command as the same user that telegraf is running as. Either your current user or as the telegraf user if you are running it as a service.

It is:

-rwxr-xr-x+ 1 telegraf telegraf 123717 Sep 25 23:28 /usr/local/telegraf/ucs_traffic_monitor.py

ok so the telegraf user and group have permissions. What happens when the telegraf user runs that command?

It throws an error for for NIkko module

Always better to provide your error, but as-is I have no idea what that is :wink: I will assume that has to do with your custom exec script. My suggestion is keep working through errors until you are able to get it to run manually.

It runs manually outside of Telegraf

hi, I’ve got the same problem. Did you find a solution?