Telegraf how to edit config


I setup influxdb using the 2.0 UI and added a telegraf config, according to the documentation I should be able to click on the name of the config and edit it, however I do not see that option? Or I should be able to do it via the CLI, which I tried by downloading the config, editing it then running influx telegrafs update -i “ID goes here” -n “xxx” -d “xxx” -f /home/ubuntu/altus.conf , however this gave me an error: “Error: Failed to get ID for org ‘Altus’ (do you have org-level read permission?): organization name “Altus” not found.”

Not quite sure what I am doing wrong, I got the ID by using: influx telegrafs -o altus
Would appreciate if someone could either explain how to update my config using the UI or the CLI I would greatly appreciate it.

When clicking the name button in the UI I get this screen, but cannot edit the config in there

Believe what you see in the GUI is just an example/suggested config. Down the bottom you click download config, and the copy that over to your servers where you’re running telegraf, and away you go. I don’t think it was intended to edit the config that gets used directly by telegraf - assuming you have an instance running on the same server as your influxdb instance (but happy to be corrected if I’m wrong)

@FixTestRepeat I may have misunderstood then, but I followed this documentation Update a Telegraf configuration | InfluxDB OSS 2.0 Documentation , I created a config using the UI, but now I want to edit it to enable the exec input plugin. According to the documentation there is 2 ways in which I can achieve that, but the UI option I can’t find and the CLI option doesn’t work( I assume I am doing something wrong).

I did download the config and upload it to /home/ubuntu, but I don’t know what to do from there either, do you have any suggestions?


Based on these two links, I assume what the UI did is make a config where it set up the agent and 1 output plugin and stored it at a remote URL endpoint, so I guess my next question would be is how do I now upload my changed config to that URL?

I could also change the huge telegraf.conf file I guess, but I already have the one so I will only do that as a last resort.

Maybe this is the same topic:

@Franky1 ah I see, imo it should not be in the documentation if it is a feature that is not yet available :sweat_smile:…anyway do you perhaps know how I go about uploading my changed config file to that remote URL endpoint?

I don’t know if that is even foreseen?
I always do it the other way round:
I have the config generated in the UI, copy it and paste the snippet into my local telegraf.conf file.

Okay, I opened the telegraf.conf file and it is quite large…do I delete everything that is in there and then paste my config in there?

I can’t give you a general answer, it depends on what you want to do with Telegraf.
As far as I know, the “large” default config file contains all the configurations of all native plug-ins - but most of them are not used.

You need at least the following sections in the config file:

  • [agent] for the global settings
  • [[outputs.influxdb_v2]] output plugin for data transfer to the InfluxDB 2.0 database
  • [[inputs.??????]] input plugins - depending on which data sources you want to collect

I am going to try deleting the default config file, then uploading my own to that folder…then I assume I need to tell telegraf where to find the new config file?

You can either refer to a local config file or to a remote one with http. See here:

yup that’s what I was referring to, I replaced the contents of the telegraf.conf file with my own config file and ran the command: telegraf --config /etc/telegraf/telegraf.conf

However, it is giving me an unauthorized access error
Edit: I think I solved it myself…had to use this before I executed that command: export INFLUX_TOKEN=<INFLUX_TOKEN>

I now have a new issue when trying to test/debug the config :sweat_smile:
tried running telegraf --config /etc/telegraf/telegraf.conf --input-filter exec --debug or with --test , and I get the error [inputs.exec] Error in plugin: exec: fork/exec /home/ubuntu/ permission denied for command ‘/home/ubuntu/’:
So I tried googling and thus I tried running
sudo chown telegraf:telegraf /home/ubuntu/ and chown telegraf
, but none worked so I am not sure what to attempt now…I am new to linux and telegraf etc so if something goes wrong it is a hassle to fix haha…