Looking at that install script it does appear that it attempts to install Telegraf and setup a custom systemd service in the configureTelegraf() function. It should have created a file /usr/lib/systemd/system/telegraf.service, does that exist? When you ran that script did it complete successfully? Or did you have to run it multiple times?
@jpowers
I don’t have telegraf.service
[root@ptest3 ~]# ll /usr/lib/systemd/system/telegraf.service
ls: cannot access /usr/lib/systemd/system/telegraf.service: No such file or directory
also I use this command to run telegraf :
/bab/telegraf/usr/bin/telegraf -config /bab/telegraf/etc/telegraf/telegraf.conf -config-directory /bab/telegraf/etc/telegraf/telegraf.d &
Also it run and works . but if reboot my OS had to run it another manually . How can run it as a service?
We provide packages to install Telegraf as a service. You have chosen to use a third-party tool to install Telegraf and that is not something we generate or have any control over.
I looked at the script you used further and it tells you in the output when you install Telegraf how to enable the service:
Successfully installed and configured telegraf agent. Ensure the environment variable IP is available with correct value.
To run Telegraf as service, modify and run telegraf.service at ${TELEGRAF_DIR}/usr/lib/telegraf/scripts/telegraf.service
Example changes are available in configureTelegraf method.
Go look at ${TELEGRAF_DIR}/usr/lib/telegraf/scripts/telegraf.service and then at the configureTelegraf() function in your install script. It shows you want you will need to change.
@jpowers
Thanks . I saw 2 files : init.sh and telegraf.service in that path and I attached them Would you please help me How can use from this and how run it as service ?
telegraf-service.tar.gz (2.2 KB)
@jpowers
Can you help me about it ?
I said in my previous replies you have at least two options:
-
Use the packages that the Telegraf project provides to correctly and easily set up Telegraf as a service.
-
Update that service file that your custom 3rd party install script created. You can read the script that you used to install Telegraf and make the necessary updates.
@jpowers
Would you please help me how can edit that 3rd party install . Would you please modify it for me and put it here ?
Do you have resolve? I had same problem !
Hi @duncandai,
As Josh has pointed out I would follow our official install as a service guide rather than using a third party install: Install Telegraf | Telegraf 1.26 Documentation
If there issues with third party installs done by VMware i would contact them directly
