Why My telegraf cannot start as service

I have installed telegraf on my os but when I ant to run it as service show follow error

I attached telegraf.conf file and telegraf.service fi

This is telegraf.conf file:

https://justpaste.it/1x2kj

Also this is telegraf.servie file :slight_smile:

https://justpaste.it/4ugmc

What is the problem ?

Please tell us:

  1. Which version of telegraf have you installed?

  2. Which operating system have you installed it on?

  3. What command are you running in order to start it?

  4. What error is displayed?

Thanks,

Antony.

1- Telegraf 1.17.0
2- Redhat 7.6
3 - now I have to run this command :
/root/telegraf/usr/bin/telegraf -config /root/telegraf/etc/telegraf/telegraf.conf -config-directory /root/telegraf/etc/telegraf/telegraf.d &

4- this is output :
[root@Oracle telegraf]# systemctl status telegraf.service
â—Ź telegraf.service - The plugin-driven server agent for reporting metrics into InfluxDB
Loaded: loaded (/usr/lib/systemd/system/telegraf.service; enabled; vendor preset: disabled)
Active: failed (Result: start-limit) since Sat 2021-11-06 18:53:57 +0330; 4s ago
Docs: GitHub - influxdata/telegraf: The plugin-driven server agent for collecting & reporting metrics.
Process: 19237 ExecStart=/usr/bin/telegraf -config /etc/telegraf/telegraf.conf -config-directory /etc/telegraf/telegraf.d $TELEGRAF_OPTS (code=exited, status=203/EXEC)
Main PID: 19237 (code=exited, status=203/EXEC)

Nov 06 18:53:57 Oracle systemd[1]: telegraf.service: main process exited, code=exited, status=203/EXEC
Nov 06 18:53:57 Oracle systemd[1]: Unit telegraf.service entered failed state.
Nov 06 18:53:57 Oracle systemd[1]: telegraf.service failed.
Nov 06 18:53:57 Oracle systemd[1]: telegraf.service holdoff time over, scheduling restart.
Nov 06 18:53:57 Oracle systemd[1]: Stopped The plugin-driven server agent for reporting metrics into InfluxDB.
Nov 06 18:53:57 Oracle systemd[1]: start request repeated too quickly for telegraf.service
Nov 06 18:53:57 Oracle systemd[1]: Failed to start The plugin-driven server agent for reporting metrics into InfluxDB.
Nov 06 18:53:57 Oracle systemd[1]: Unit telegraf.service entered failed state.
Nov 06 18:53:57 Oracle systemd[1]: telegraf.service failed.

This command should give the output of telegraf. Could you run it and post the output?

journalctl -u telegraf.service

Systemd is trying to start telegraf a few times every time you boot. If the journalctl command prints out the same output over and over, just post the most recent cycle.

This is my output :

https://justpaste.it/761a7

Can anyone help me to solve the issue ?

In my opinion, there is unfortunately nothing in the output that would allow conclusions to be drawn about the cause.
Leave out systemd and start Telegraf manually - what happens then and what output comes?

but according to output the seems has problem with influxDB I think this is not rational to run service manually . because if reboot the system will not run automatically

No, Telegraf crashes directly when trying to start.
This can have many reasons, most likely an error in the config file.
So we try to reduce the complexity of the problem and take out systemd first. After that I would take a look at the config file and systematically reduce and narrow down the possible errors.

The config file you posted on JustePaste is unfortunately hardly readable because it is not formatted as a toml file and you can’t see at all what is commented out and what is not.

Unfortunately cannot upload file here . This is telegraf.conf file here :slight_smile:

So first of all, posting a whole conf file is not very debug friendly. Only the sections that are not commented out, i.e. are actually used, are interesting.

Then I immediately notice that everything is commented out, when I skim the file I don’t see a single configured input or output plugin. Telegraf needs at least one input and one output plugin to work. What do you expect Telegraf to do without configuration? :smirk:

I am really confuse would you please help me in the first step run telegraf as service and in second step
will set for input and output

No, sorry, first of all please tell me what you want to do with Telegraf.
What is your goal? What are your inputs and outputs?
Otherwise we will waste a lot of time, which we already did… :angry:

I have the other app that will get data from telegraf and show metrics on that now I can instal telegraf and after run it manually it shows metrics . Now my main problem is just cannot run it as service.

Would you please help me about it ? in the first step I just want to start telegraf as service

Can you help me please?