Here some additional info, on my setup, sudo systemctl start telegraf
Add a telegraf.service located in
“/usr/lib/systemd/system/telegraf.service”
with a link to
“/etc/systemd/system/multi-user.target.wants/telegraf.service”
File Telegraf.service
[Unit]
Description=The plugin-driven server agent for reporting metrics into InfluxDB
Documentation=GitHub - influxdata/telegraf: The plugin-driven server agent for collecting & reporting metrics.
After=network.target
[Service]
EnvironmentFile=-/etc/default/telegraf
User=_telegraf
Group=_telegraf
ExecStart=/usr/bin/telegraf --config http://xxx.xxx.xxx.xxx:8086/api/v2/telegrafs/084bc78a1facc000 -$TELEGRAF_OPTS
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-failure
RestartForceExitStatus=SIGPIPE
KillMode=control-group
[Install]
WantedBy=multi-user.target
As in my previous post, it seams to work but no data and no PID found.
Here the journaling output:
Oct 19 07:34:48 HA-homeservices systemd[1]: Started The plugin-driven server agent for reporting metrics into InfluxDB.
Oct 19 07:34:49 HA-homeservices telegraf[2027]: flag provided but not defined: -$TELEGRAF_OPTS
Oct 19 07:34:49 HA-homeservices telegraf[2027]: Telegraf, The plugin-driven server agent for collecting and reporting metrics.
Oct 19 07:34:49 HA-homeservices telegraf[2027]: Usage:
Oct 19 07:34:49 HA-homeservices telegraf[2027]: telegraf [commands|flags]
Oct 19 07:34:49 HA-homeservices telegraf[2027]: The commands & flags are:
Oct 19 07:34:49 HA-homeservices telegraf[2027]: config print out full sample configuration to stdout
Oct 19 07:34:49 HA-homeservices telegraf[2027]: version print the version to stdout
Oct 19 07:34:49 HA-homeservices telegraf[2027]: --aggregator-filter filter the aggregators to enable, separator is :
Oct 19 07:34:49 HA-homeservices telegraf[2027]: --config configuration file to load
Oct 19 07:34:49 HA-homeservices telegraf[2027]: --config-directory directory containing additional *.conf files
Oct 19 07:34:49 HA-homeservices telegraf[2027]: --plugin-directory directory containing *.so files, this directory will be
Oct 19 07:34:49 HA-homeservices telegraf[2027]: searched recursively. Any Plugin found will be loaded
Oct 19 07:34:49 HA-homeservices telegraf[2027]: and namespaced.
Oct 19 07:34:49 HA-homeservices telegraf[2027]: --debug turn on debug logging
Oct 19 07:34:49 HA-homeservices telegraf[2027]: --input-filter filter the inputs to enable, separator is :
Oct 19 07:34:49 HA-homeservices telegraf[2027]: --input-list print available input plugins.
Oct 19 07:34:49 HA-homeservices telegraf[2027]: --output-filter filter the outputs to enable, separator is :
Oct 19 07:34:49 HA-homeservices telegraf[2027]: --output-list print available output plugins.
Oct 19 07:34:49 HA-homeservices telegraf[2027]: --pidfile file to write our pid to
Oct 19 07:34:49 HA-homeservices telegraf[2027]: --pprof-addr pprof address to listen on, don’t activate pprof if empty
Oct 19 07:34:49 HA-homeservices telegraf[2027]: --processor-filter filter the processors to enable, separator is :
Oct 19 07:34:49 HA-homeservices telegraf[2027]: --quiet run in quiet mode
Oct 19 07:34:49 HA-homeservices telegraf[2027]: --section-filter filter config sections to output, separator is :
Oct 19 07:34:49 HA-homeservices telegraf[2027]: Valid values are ‘agent’, ‘global_tags’, ‘outputs’,
Oct 19 07:34:49 HA-homeservices telegraf[2027]: ‘processors’, ‘aggregators’ and ‘inputs’
Oct 19 07:34:49 HA-homeservices telegraf[2027]: --sample-config print out full sample configuration
Oct 19 07:34:49 HA-homeservices telegraf[2027]: --once enable once mode: gather metrics once, write them, and exit
Oct 19 07:34:49 HA-homeservices telegraf[2027]: --test enable test mode: gather metrics once and print them
Oct 19 07:34:49 HA-homeservices telegraf[2027]: --test-wait wait up to this many seconds for service
Oct 19 07:34:49 HA-homeservices telegraf[2027]: inputs to complete in test or once mode
Oct 19 07:34:49 HA-homeservices telegraf[2027]: --usage print usage for a plugin, ie, ‘telegraf --usage mysql’
Oct 19 07:34:49 HA-homeservices telegraf[2027]: --version display the version and exit
Oct 19 07:34:49 HA-homeservices telegraf[2027]: Examples:
Oct 19 07:34:49 HA-homeservices telegraf[2027]: # generate a telegraf config file:
Oct 19 07:34:49 HA-homeservices telegraf[2027]: telegraf config > telegraf.conf
Oct 19 07:34:49 HA-homeservices telegraf[2027]: # generate config with only cpu input & influxdb output plugins defined
Oct 19 07:34:49 HA-homeservices telegraf[2027]: telegraf --input-filter cpu --output-filter influxdb config
Oct 19 07:34:49 HA-homeservices telegraf[2027]: # run a single telegraf collection, outputting metrics to stdout
Oct 19 07:34:49 HA-homeservices telegraf[2027]: telegraf --config telegraf.conf --test
Oct 19 07:34:49 HA-homeservices telegraf[2027]: # run telegraf with all plugins defined in config file
Oct 19 07:34:49 HA-homeservices telegraf[2027]: telegraf --config telegraf.conf
Oct 19 07:34:49 HA-homeservices telegraf[2027]: # run telegraf, enabling the cpu & memory input, and influxdb output plugins
Oct 19 07:34:49 HA-homeservices telegraf[2027]: telegraf --config telegraf.conf --input-filter cpu:mem --output-filter influxdb
Oct 19 07:34:49 HA-homeservices telegraf[2027]: # run telegraf with pprof
Oct 19 07:34:49 HA-homeservices telegraf[2027]: telegraf --config telegraf.conf --pprof-addr localhost:6060
Oct 19 07:34:49 HA-homeservices systemd[1]: telegraf.service: Succeeded.
It seams that something is not working with the -$TELEGRAF_OPTS.
Any idea?
Another question, the PID created, should be listed by the ps command?
Thanks again for the support.