Telegraf/WINDOWS_ At Master - GitHub
Có thể bạn quan tâm
- Notifications You must be signed in to change notification settings
- Fork 5.6k
- Star 15k
- Code
- Issues 325
- Pull requests 25
- Actions
- Projects 0
- Security
- Insights
Files
masterBreadcrumbs
- telegraf
- docs
Latest commit
History
History129 lines (94 loc) · 4.84 KB masterBreadcrumbs
- telegraf
- docs
File metadata and controls
- Preview
- Code
- Blame
Telegraf natively supports running as a Windows Service. Outlined below is are the general steps to set it up.
-
Obtain the telegraf windows distribution
-
Create the directory C:\Program Files\Telegraf or use a custom directory if desired
-
Place the telegraf.exe and the telegraf.conf config file into the directory, either C:\Program Files\Telegraf or the custom directory of your choice. If you install in a different location simply specify the --config parameter with the desired location.
-
To install the service into the Windows Service Manager, run the command as administrator. Make sure to wrap parameters containing spaces in double quotes:
> "C:Program Files\Telegraf\telegraf.exe" service install -
Edit the configuration file to meet your needs
-
To check that it works, run:
> "C:\Program Files\Telegraf\telegraf.exe" --config "C:\Program Files\Telegraf\telegraf.conf" --test -
To start collecting data, run:
> net start telegrafor
> "C:\Program Files\Telegraf\telegraf.exe" service startor use the Windows service manager to start the service
Please also check the Windows event log or your configured log-file for errors during startup.
Config Directory
You can also specify a --config-directory for the service to use:
-
Create a directory for config snippets: C:\Program Files\Telegraf\telegraf.d
-
Include the --config-directory option when registering the service:
> "C:\Program Files\Telegraf\telegraf.exe" --config C:\"Program Files"\Telegraf\telegraf.conf --config-directory C:\"Program Files"\Telegraf\telegraf.d service install
Other supported operations
Telegraf can manage its own service through the --service flag:
Command | Effect |
---|---|
telegraf.exe service install | Install telegraf as a service |
telegraf.exe service uninstall | Remove the telegraf service |
telegraf.exe service start | Start the telegraf service |
telegraf.exe service stop | Stop the telegraf service |
telegraf.exe service status | Query the status of the telegraf service |
Install multiple services
Running multiple instances of Telegraf is seldom needed, as you can run multiple instances of each plugin and route metric flow using the metric filtering options. However, if you do need to run multiple telegraf instances on a single system, you can install the service with the --service-name and --display-name flags to give the services unique names:
> "C:\Program Files\Telegraf\telegraf.exe" --service-name telegraf-1 service install --display-name "Telegraf 1" > "C:\Program Files\Telegraf\telegraf.exe" --service-name telegraf-2 service install --display-name "Telegraf 2"Auto restart and restart delay
By default the service will not automatically restart on failure. Providing the --auto-restart flag during installation will always restart the service with a default delay of 5 minutes. To modify this to for example 3 minutes, additionally provide --restart-delay 3m flag. The delay can be any valid time.Duration string.
Troubleshooting
When Telegraf runs as a Windows service, Telegraf logs all messages concerning the service startup to the Windows event log. All messages and errors occuring during runtime will be logged to the log-target you configured. Check the event log for errors reported by the telegraf service (or the service-name you configured) during service startup: Event Viewer -> Windows Logs -> Application
Common error #1067
When installing as service in Windows, always double check to specify full path of the config file, otherwise windows service will fail to start. Use
> "C:\Program Files\Telegraf\telegraf.exe" --config "C:\MyConfigs\telegraf.conf" service installinstead of
> "C:\Program Files\Telegraf\telegraf.exe" --config "telegraf.conf" service installService is killed during shutdown
When shuting down Windows the Telegraf service tries to cleanly stop when receiving the corresponding notification from the Windows service manager. The exit process involves stopping all inputs, processors and aggregators and finally to flush all remaining metrics to the output(s). In case many metrics are not yet flushed this final step might take some time. However, Windows will kill the service and the corresponding process after a predefined timeout (usually 5 seconds).
You can change that timeout in the registry under
HKLM\SYSTEM\CurrentControlSet\Control\WaitToKillServiceTimeout ``` **NOTE:** The value is in milliseconds and applies to **all** services! You can’t perform that action at this time.Từ khóa » File đuôi Md
-
MD Là File Gì? Phần Mềm & Cách Mở File . MD, Sửa File Lỗi
-
File MD Là Gì?
-
Làm Thế Nào để Mở Tập Tin .MD? Thông Tin Về đuôi - Driversol
-
MD Là File Gì? Cách Mở File .MD - Từ điển Số
-
Dùng Phần Mềm Gì để Xem File Có đuôi Md?
-
MD File Extension - What Is An .md File And How Do I Open It?
-
Md Là File .Md Là Gì - Phần Mềm & Cách Mở File - Noithatvietphat
-
Cách Mở File MD
-
Markdown - Viết Tài Liệu Chưa Bao Giờ Dễ Dàng Thế
-
What Is The Asv File In MATLAB And How Do I Open It? - - MathWorks
-
What Is A .MD File? (And How To Open One) - Lifewire
-
Cách Viết README Md - Học Tốt
-
Một Số Cách Cấu Hình File Htaccess - GitHub