voxpupuli / puppet-telegraf Goto Github PK
View Code? Open in Web Editor NEWA Puppet module for installing and configuring InfluxData's Telegraf
Home Page: https://forge.puppet.com/puppet/telegraf
License: GNU General Public License v3.0
A Puppet module for installing and configuring InfluxData's Telegraf
Home Page: https://forge.puppet.com/puppet/telegraf
License: GNU General Public License v3.0
baseurl=https://repos.influxdata.com/rhel/$releasever/$basearch/stable
python -c 'import yum, pprint; yb = yum.YumBase(); pprint.pprint(yb.conf.yumvar, width=1)'
Loaded plugins: kernel-module, priorities, protectbase, versionlock
{'arch': 'ia32e',
'basearch': 'x86_64',
'releasever': '6.7',
}
For CC7 the releasever is 7, inspite of the release
This can be corrected if on line 32 in install.pp we change the $releasever with for example
${facts['os']['release']['major']
I have a question regarding sections and win_perf_counters. I have browse issues and commits of this repo and can't find my answer.
How do you have multiple sections in the same telegraf::input ?
Here's an example :
telegraf::input { 'memory':
plugin_type => 'win_perf_counters',
sections => {
'win_perf_counters.object' => {
'ObjectName' => 'Memory',
'Counters' => ["Available Bytes", "Cache Faults/sec", "Demand Zero Faults/sec", "Page Faults/sec", "Pages/sec", "Transition Faults/sec", "Pool Nonpaged Bytes", "Pool Paged Bytes"],
'Instances' => ["*"],
'Measurement' => "win_mem",
}
}
}
Let's say I want to add Network counters to this. How do you do it ? Because it's only accepting hashes and you can't have the same key twice.
Network counters :
'win_perf_counters.object' => {
'ObjectName' => 'Network Interface',
'Counters' => ["Bytes Received/sec","Bytes Sent/sec","Bytes Total/sec","Packets Received/sec","Packets Sent/sec"],
'Instances' => ["*"],
'Measurement' => "win_net",
}
Thanks!
Hi,
could it be, that the usage of "sections" is not correct? According to the docu here is the example of logparser input plugin: https://github.com/influxdata/telegraf/tree/master/plugins/inputs/logparser
So the section is starting like [inputs.logparser.grok]
, so only with one quote. If using your implementation the config is [[inputs.logparser.grok]]
and I am getting in logs: logparser.LogParserPlugin.GrokParser' must be slice type, but ptr given
to corrected this I chnaged the template input.conf.erb
like this one:
<% unless @options == nil -%>
<% @options.sort.each do | option, value | -%>
<%= option -%> = <% if value.is_a?(String) %>"<%= value %>"<% elsif value.is_a?(Array) %><%= value.inspect %><% else %><%= value %><% end %>
<% end -%>
<% end -%>
<% if @sections -%>
<% @sections.sort.each do |section, option| -%>
[inputs.<%= section %>]
<% unless option == nil -%>
<% option.sort.each do | suboption, value | -%>
<%= suboption -%> = <% if value.is_a?(String) %>"<%= value %>"<% elsif value.is_a?(Array) %><%= value.inspect %><% else %><%= value %><% end %>
<% end -%>
<% end -%>
<% end -%>
<% end -%>
~
What do you think?
I was trying to use the following Hiera configuration to create a Telegraf input:
telegraf::inputs:
elasticsearch:
cluster_health: true
local: false
servers: ['http://127.0.0.1']
tags:
role: 'some_role'
This resulted in the following (snippet) of configuration:
[[inputs.elasticsearch]]
cluster_health = true
local = false
servers = ["http://127.0.0.1"]
tags = {"role"=>"some_role"}
This is wrong and causes telegraf
to fail:
Error parsing /etc/telegraf/telegraf.conf, toml: line 42: parse error
Rather, it should become;
[[inputs.elasticsearch]]
cluster_health = true
local = false
servers = ["http://127.0.0.1"]
[inputs.elasticsearch.tags]
role = "some_role"
It looks like this is already supported by telegraf::input
, so I think that the real issue here is that specifying inputs in $telegraf::inputs
doesn't actually utilize the telegraf::input
resource.
I am using the following Puppet code:
telegraf::input { 'statsd':
options => {
service_address => '127.0.0.1:8125',
allowed_pending_messages => 10000,
},
}
This results in the following Telegraf configuration:
[[inputs.statsd]]
allowed_pending_messages = "10000"
service_address = "127.0.0.1:8125"
templates = ["logstash.* namespace.sender.measurement*"]
This configuration is invalid and Telegraf reports the following error:
Error parsing /etc/telegraf/telegraf.d/statsd.conf, line 2: statsd.Statsd.AllowedPendingMessages: `string' type is not assignable to `int' type
The problem here is that Puppet doesn't differentiate between numbers and strings (at least until Puppet 4, unless using the future parser). I was able to workaround this issue with the following Puppet code:
telegraf::input { 'statsd':
options => {
service_address => '127.0.0.1:8125',
allowed_pending_messages => 0 + 10000,
},
}
Ideally though, the template used by telegraf::input
would check if a configuration option is numeric and remove the quotes.
Using this copy/pasted from the README:
telegraf::input { 'my_snmp':
plugin_type => 'snmp',
options => {
'interval' => '60s',
'host' => [
{
'address' => 'snmp_host1:161',
'community' => 'read_only',
'version' => 2,
'get_oids' => ['1.3.6.1.2.1.1.5',],
}
],
'tags' => {
'environment' => 'development',
},
},
}
Results in:
Server Error: Evaluation Error: Error while evaluating a Resource Statement, Telegraf::Input[my_snmp]: parameter 'options' expects an Array value, got Struct
I would expect options
to still work as a hash, as before and as still documented. It seems like it's now mandatory to have it be an array.
Updating from 1.5.0 to 4.0.0 has broken such code for me:
# interrupts : waaay too much data, we only care about network
telegraf::input { 'interrupts-tagpass':
plugin_type => 'interrupts',
options => {
'tagpass' => [
'irq' => [ 'NET_RX', 'NET_TX' ],
]
},
}
The above created the following configuration:
[[inputs.interrupts]]
[inputs.interrupts.tagpass]
irq = ["NET_RX", "NET_TX"]
It now seems impossible to achieve it, as enclosing the options's {} into [] creates the 2nd line with double brackets, which no longer works.
Inputs and outputs (and aggregators if I ever get a PR ready for that) that previously had no configuration no longer work.
cpu:
was previously enough to create a cpu input. Now cpu:
fails because telegraf.conf.erb:80 expects it to contain an array, and cpu: []
fails because the first element of that array is expected to be a hash. I find myself having to do some nonsense like this:
cpu:
- placeholderkey: placeholdervalue
which of course ends up polluting my actual telegraf.conf with those placeholders.
If there's a better way to make this work with the new code from #80, I would love to know. If there's not, this seems severe enough to be a bug in need of fixing, and maybe fixing it would also address the minor annoyance of old configs not working with the new code; it would be nice if the code recognized a bare hash as functionally identical to an array containing one hash.
Using hiera 5 requires using the lookup function in place of hiera_xxx() functions. (hiera lookup docs).
Without updating this, deep merging using hiera 5 is impossible with this module, but updating will break compatibility with hiera 3.
Currently this module does not purge unmanaged files from /etc/telegraf/telegraf.d
. Would it be possible to add this functionality? It looks like this was previously attempted in #21, but that pull request was later abandoned.
I'd like to be able to use the same input type multiple times with different configurations. For example, I have 2 urls that I'd like to monitor with http_response inputs. I'd like to use hiera to configure the inputs. Right now given the way the hiera hash is used it will only keep 1 of the repeated inputs.
We are running Varnish 4.1 and using the following Telegraf configuration in order to send Varnish stats to InfluxDB:
telegraf::inputs:
exec:
commands:
- 'varnishstat -j'
data_format: 'json'
This doesn't quite work for Varnish 4.1, however, because the telegraf
user is not a member of the varnish
group. I was able to work around this problem by adding the following puppet code:
user { 'telegraf':
groups => ['varnish'],
home => '/etc/telegraf',
managehome => false,
shell => '/bin/false',
system => true,
require => Class['varnish::install'],
}
It would be more convenient, however, if this module exposed a $groups
parameter which would allow me to do this:
class { 'telegraf':
groups => ['varnish'],
}
Some related resources:
telegraf::input { 'NetworkInterface':
plugin_type => 'win_perf_counters.object',
options => [{
'ObjectName' => 'NetworkInterface',
'Instances' => ['*'],
'Counters' => [
'Bytes Received/sec',
'Bytes Sent/sec',
'Packets Received/sec',
'Packets Sent/sec',
],
'Measurement' => 'win_net',
'IncludeTotal' => false,
'tags' => {
'app' => 'metrics',
},
}]
}
[[inputs."win_perf_counters.object"]]
Counters = ["Bytes Received/sec", "Bytes Sent/sec", "Packets Received/sec", "Packets Sent/sec"]
IncludeTotal = false
Instances = ["*"]
Measurement = "win_net"
ObjectName = "NetworkInterface"
[inputs."win_perf_counters.object".tags]
app = "metrics"
[[inputs.win_perf_counters.object]]
Counters = ["Bytes Received/sec", "Bytes Sent/sec", "Packets Received/sec", "Packets Sent/sec"]
IncludeTotal = false
Instances = ["*"]
Measurement = "win_net"
ObjectName = "NetworkInterface"
[inputs.win_perf_counters.tags]
app = "metrics"
Thanks for any help
Hi,
Very minor fix, but please change the puppetlabs-stdlib (>=5.0.0 < 7.0.0)
to the standard puppetlabs-stdlib (>= 5.0.0 < 7.0.0)
format.
We have scripts that scan for module updates and dependencies and I've had to tweak it especially for this ;)
Thanks,
Dave
Hi,
I'm using your module with the following configuration:
# site/profile/manifests/monitoring.pp
class profile::monitoring (
$inputs = lookup('profile::monitoring::inputs', Hash, 'hash'),
$outputs = lookup('profile::monitoring::outputs', Hash, 'hash'),
) {
class { '::telegraf':
hostname => $::hostname,
inputs => $inputs,
outputs => $outputs,
}
}
# data/global.yml
#...
profile::monitoring::inputs:
cpu:
percpu: false
totalcpu: true
collect_cpu_time: false
disk:
diskio:
kernel:
mem:
processes:
swap:
system:
nstat:
puppetagent:
profile::monitoring::outputs:
influxdb:
urls:
- http://influx.domain.tld
#...
When I execute the agent on the monitoring node, I have an undefined method 'sort' for :undef:Symbol
error:
root@monitoring-dev-1:~# puppet agent -t
Info: Using configured environment 'dev'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Failed to parse template telegraf/telegraf.conf.erb:
Filepath: /etc/puppetlabs/code/environments/dev/modules/telegraf/templates/telegraf.conf.erb
Line: 47
Detail: undefined method `sort' for :undef:Symbol
at /etc/puppetlabs/code/environments/dev/modules/telegraf/manifests/config.pp:12:18 on node monitoring-dev-1.local.tld
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
I'm pretty new to puppet but I think the problem is that an undefined
value in a Hash
is not nil
in a template, even if the official latest documentation about template says otherwise
# case 1: this is gonna fail since the `cpu` value is undefined
profile::monitoring::inputs:
cpu:
# case 2: this is gonna pass because the `cpu` value is defined
profile::monitoring::inputs:
cpu:
percpu: false
totalcpu: true
collect_cpu_time: false
# case 3: this is gonna pass because the `cpu` value is explicitly set to an empty hash
# https://stackoverflow.com/questions/33510094/syntax-for-empty-dictionary-in-yaml
profile::monitoring::inputs:
cpu: {}
The error is in the modules/telegraf/templates/telegraf.conf.erb
file line 47 (for inputs):
# modules/telegraf/templates/telegraf.conf.erb
#...
<% if @_inputs -%>
#
# INPUTS:
#
<% @_inputs.sort.each do | input, options | -%>
[[inputs.<%= input %>]]
<% unless options == nil -%> # option will not be nil in case 1
<% options.sort.each do | option, value | -%> # gonna fail here since undefined does not have a sort function
<%= option -%> = <% if value.is_a?(String) %>"<%= value %>"<% elsif value.is_a?(Array) %><%= value.inspect %><% else$
<% end -%>
<% end -%>
<% end -%>
<% end -%>
As mentioned above, if we explictly set a hash key to {}
the options
variable will not be nil
or undefined
and the template will not fail to find the sort
function.
Another solution can be to explicitly check for undefined symbol in the erb template like this:
# modules/telegraf/templates/telegraf.conf.erb
#...
<% if @_inputs -%>
#
# INPUTS:
#
<% @_inputs.sort.each do | input, options | -%>
[[inputs.<%= input %>]]
<% unless options == nil or options == :undef -%> # explicitly check for nil or undefined values
<% options.sort.each do | option, value | -%>
<%= option -%> = <% if value.is_a?(String) %>"<%= value %>"<% elsif value.is_a?(Array) %><%= value.inspect %><% else$
<% end -%>
<% end -%>
<% end -%>
<% end -%>
I personally choose the solution with explicit {}
for empty values.
Hope I didnt miss something and this is gonna help,
Thanks for the module,
krostar
Via @ntent-ashton, originally called out in #6:
If $manage_repo is true, requiring the repo by that name is fine - but if $manage_repo is false, install.pp fails at this step.
Find these errors while running puppet agent
Execution of '/usr/bin/yum -d 0 -e 0 -y list telegraf' returned 1: Error: Cannot retrieve repository metadata (repomd.xml) for repository: influxdata. Please verify its path and try again
Was this intentional or even discussed prior to merging #80? toml-rb requires Ruby 1.9 (and didn't say so, until I filed an issue on it), which means that puppet-telegraf now requires Ruby 1.9
Hey,
from @nrdmn 's suggestions at #96 (comment) I modified the hieradata, manifests and profiles to match 2.0 syntax.
This works now, but I do encounter an unwanted behaviour nevertheless. It seems like only the first section is rendered at all (even with some more patterns, nginx is the only one that gets written to telegraf.conf, when I change the sequence then the new first one is going to be written to conf instead):
What I did:
telegraf::inputs:
procstat:
- pattern: "nginx"
pid_tag: true
- pattern: "php.*-fpm"
pid_tag: true
What I expected:
[[inputs.procstat]]
pattern = "nginx"
pid_tag = true
[[inputs.procstat]]
pattern = "php.*-fpm"
pid_tag = true
What I got instead:
[[inputs.procstat]]
pattern = "nginx"
pid_tag = true
Can this be a result of using the deep_merge gem?
System Specs
On windows i get:
Error while evaluating a Resource Statement, Class[Telegraf]: parameter 'repo_location' expects a String value, got Undef
in the class params
repo_location
is not set for windows but is mandatory on class telegraf
.
I think this was introducted by 1cce2d3, because defining type String
it's a mandatory parameter by default.
You should use Optional[String]
or handle it in the class itself.
As a workaround, I set it to an empty string for windows:
repo_location => ($::kernel) ? { 'windows' => '', default => undef },
In release 2.0.0
on Puppet Forge are included log files that are certainly not needed, from checksums.json
{
"AUTHORS": "f0fe40cb06e992d26057e516aa3e4080",
"Gemfile": "fa251bd95355643a883051c2b86e302a",
"LICENSE": "84dcc94da3adb52b53ae4fa38fe49e5d",
"README.md": "9c781b49c824910c59022fb6fbe98f61",
"Rakefile": "98ec43598e100b1fb8d6f3c032637621",
"log/default/2017-02-28_15_51_27/sut.log": "d41d8cd98f00b204e9800998ecf8427e",
"log/default/2017-03-01_20_08_31/sut.log": "d41d8cd98f00b204e9800998ecf8427e",
"log/default/2017-03-01_20_13_20/sut.log": "d41d8cd98f00b204e9800998ecf8427e",
"log/default/2017-03-01_20_18_06/sut.log": "d41d8cd98f00b204e9800998ecf8427e",
...
Some of the telegraf inputs don't have many options and have good defaults (haproxy for example.) In the case of these type of modules, it'd be nice to be able to specify an input with just a plugin_type. If options isn't passed the input template fails to apply when it tries to iterate over the empty options hash.
Hello,
I defined a global output for all hosts, except the DMZ host. My problem is, that I get two output URL in my outputs, the first one is the global (not needed), the second is the one, I need. I use also the changes from: #99
I tried to use:
lookup_options:
"^telegraf::outputs(.*)$":
merge:
strategy: first
but it does not work. I get always both URLs, instead of only this one, if defined in my host.yaml.
We use the same for the "apt" class, and this works as expected. What I have done wrong ?
Any suggestions ?
They're currently not running following #111 being merged.
include telegraf
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Internal Server Error: org.jruby.exceptions.RaiseException: (LoadError) no such file to load -- toml-rb
it should install telegraf
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Internal Server Error: org.jruby.exceptions.RaiseException: (LoadError) no such file to load -- toml-rb
toml-rb (1.1.2) was installed
please update package dependencies to allow puppet 6.
this means allowing stdlib 6.x.x as well as apt 6.x.x
Install breaks with newer version of apt module. The below look a bit weird as we install from .tar.gz packages with --ignore-dependencies (and not always in order).
root@citest:/home/htj# puppet module install /var/cache/cosmos/model/puppet-modules/puppetlabs-apt-4.1.0.tar.gzNotice: Preparing to install into /etc/puppetlabs/code/environments/production/modules ...
Notice: Downloading from https://forgeapi.puppet.com ...
Error: Could not install module 'puppetlabs-apt' (???)
No version of 'puppetlabs-apt' can satisfy all dependencies
Use puppet module install --ignore-dependencies
to install only this module
Hello
Could you please bump your module to 1.5.0 ? :)
Thank you
Via @spjmurray:
When 80f0f1c was introduced it added a
dependency that the influxdata apt::source only be installed after the apt
https transport package was installed. Some installations rely on all
packages being installed after the apt::update has been executed to ensure
with a single global statement that all packages are at their latest. This
patch ensures that the prerequisite can be installed successfully regardless
of how the environment is configured.
Reverting this commit and assuming that system maintainers will be responsible for ensuring that HTTPS-enabled apt repos are usable is probably the right thing to do.
It would be convenient if this module could do something similar to https://forge.puppet.com/yo61/logrotate, which exposes a $hieramerge
parameter:
# apply user-defined rules
class logrotate::rules{
$hieramerge = $::logrotate::hieramerge
$rules = $::logrotate::rules
if $hieramerge {
$_rules = hiera_hash('logrotate::rules', $rules)
} else {
$_rules = $rules
}
create_resources('logrotate::rule', $_rules)
}
Currently, we are using the following workaround:
class { 'telegraf':
inputs => hiera_hash('telegraf::inputs'),
outputs => hiera_hash('telegraf::outputs'),
}
This workaround is required because Puppet 3's automatic parameter lookup doesn't support deep merging.
I'd like to set 2 different telegraf outputs, one tagged, one default.
When using hiera
telegraf::outputs:
influxdb:
- urls:
- "http://sys.home.local:8086"
database: 'telegraf'
skip_database_creation: false
The title is also the output type. I didn't see an easy way to change that, I'd expect
telegraf::outputs:
influxdb:
- urls:
- "http://sys.home.local:8086"
database: 'telegraf'
skip_database_creation: false
influxdb_other:
plugin_type: 'influxdb'
- urls:
- "http://sys.home.local:8086"
database: 'data'
skip_database_creation: false
would work, but it doesn't (bad yaml). Do you have an example using hiera with 2 different outputs?
Currently values passed as $input
(and $output) are used as the default to fall back on if a valid hiera hash is not found.
My expectation was that passing $input or $output directly would override the hiera values (but I'm relatively new to puppet). Is the behavior of these parameters consistent with other puppet modules?
I came across this when looking for a way to modify the hiera data going to the telegraf module so that I don't need to set up a custom fact or implement an ENC for an "arbitrary" subset of nodes.
The following YAML
telegraf::inputs:
multifile:
- base_dir: "/sys/class/thermal"
multifile.file:
- file: "thermal_zone2/temp"
dest: "pch_skylake"
conversion: "float(3)"
- file: "thermal_zone3/temp"
dest: "x86_pkg_temp"
conversion: "float(3)"
converts to
[[inputs.multifile]]
base_dir = "/sys/class/thermal"
[[inputs."multifile.file"]]
file = "thermal_zone2/temp"
dest = "pch_skylake"
conversion = "float(3)"
[[inputs."multifile.file"]]
file = "thermal_zone3/temp"
I would expect to be able to use multifile.file
in the appropriate way. Telegraf does not startup with quotes in the config. I'm unsure what has to happen on the YAML side to use this module correctly. Using inputs.temp puts too much data points and unwanted sensors that are not as easy to work with. Otherwise, I suppose I could use two file modules, though multifile seemed to fit and converts will from 1000 -> 1.000
Currently, any configuration changes after the service has started fail to trigger any kind of reload so that the agent picks up the new values. This should be fixed so that they do - apparently this can be done gracefully (i.e without downtime) by sending a SIGHUP
to the process - influxdata/telegraf#69
Use the puppet-telegraf
4.0.0 with manage_repo=>false
, which will cause catalog compilation errors.
Error 500 on SERVER: Server Error: Could not find resource 'Yumrepo[influxdata]' for relationship on 'Package[telegraf]'
This issue has been fixed in the master branch when #160 was merged, however has not been released into a version on the forge.
Please release a version that includes #160.
Apply Module to an Ubuntu 20.04 LTS node.
Public Key not available for the repository.
The pubkey being available.
Notice: /Stage[main]/Apt::Update/Exec[apt_update]/returns: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 684A14CF2582E0C5
Notice: /Stage[main]/Apt::Update/Exec[apt_update]/returns: Reading package lists...
Notice: /Stage[main]/Apt::Update/Exec[apt_update]/returns: W: GPG error: https://repos.influxdata.com/ubuntu focal InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 684A14CF2582E0C5
Seems the key has changed today. On the repos.influxdata.com site, the old key is now "influxdb.key.old".
I have quite specific setup - I'm running puppet in some old, long running docker containers. Probably due to that the "networking" fact is empty on such nodes which causes:
{"message":"Server Error: Evaluation Error: Operator '[]' is not applicable to an Undef Value. (file: /etc/puppet/environments/production/modules/telegraf/manifests/params.pp, line: 37, column: 29)
This line is the problem:
$hostname = $facts['networking']['hostname']
Even when I pass the $hostname directly when I initialize telegraf module the default value can't be fetched from facts and whole catalog fails.
mon-01-59c36840-1d9d-4ec4-a4e8-317b19e83d3c:~ # facter -p networking -j
{
"networking": null
}
That's a good question. The catalog compilation shouldn't fail when $hostname is provided and default value cannot be resolved.
mon-01-59c36840-1d9d-4ec4-a4e8-317b19e83d3c:~ # facter -p networking -j
{
"networking": null
}
I am running into permission issues when using inputs
telegraf::input { 'windows1':
plugin_type => 'win_perf_counters',
sections => {
'win_perf_counters.object' => {
'ObjectName' => 'Network Interface',
'Counters' => ["Bytes Received/sec","Bytes Sent/sec","Bytes Total/sec","Packets Received/sec","Packets Sent/sec"],
'Instances' => ["*"],
'Measurement' => "win_net",
}
}
}
It would make more sense to change the mode in config.pp from 0750
to 0770
as, by default, the group manages the file.
This was tested successfully and fixed permission issues.
The telefraf config can easily be managed using inifile resources instead of requiring the toml-rb gem... are you open to a PR for that? I just wanted to check prior to doing the work.
telegraf 1.1.0 added a logfile
config parameter but it doesn't appear that this puppet module yet supports it. Is there a work around available you could suggest?
I've naively tried:
class { '::telegraf':
...
logfile => '/path/to/file',
...
}
Typically when I look to see what versions are available for a puppet module in puppetforge, I can see all previous versions. If you take a look at https://forge.puppet.com/puppet/telegraf it only lists version 2.1.0. Not able to download/install previous versions with puppet module install
.
There is an error in logfile variable.
While the params.pp and init.pp talks about the variable log_file, the template (telegraf.conf.erb) references the variable logfile.
Hey,
I probably misunderstood something about the patches in #80, but I fail to implement multiple procstat sections.
What I did:
procstat-nginx:
- pattern: "nginx"
pid_tag: true
plugin_type: "procstat"
procstat-php-fpm:
- pattern: "php.*-fpm"
pid_tag: true
plugin_type: "procstat"
What I expected:
[[inputs.procstat]]
pattern = "nginx"
pid_tag = true
[[inputs.procstat]]
pattern = "php.*-fpm"
pid_tag = true
What I got instead:
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, Failed to parse template telegraf/telegraf.conf.erb:
Filepath: /etc/puppetlabs/code/environments/production/modules/telegraf/templates/telegraf.conf.erb
Line: 35
Detail: undefined method `each' for nil:NilClass
at /etc/puppetlabs/code/environments/production/modules/telegraf/manifests/config.pp:12:18 on node $SERVERNAME
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run
System Specs
I use the graphite output of telegraf, and all configuration is done via Hiera. In my common.yaml I have defined:
telegraf::outputs:
graphite:
- servers:
- "graphite:2003"
template: "host.tags.measurement.field"
And in various other files throughout the hierarchy I also add an extra option to the output using:
telegraf::outputs:
graphite:
- prefix: server-role
In order for this to merge correctly, I need to use Hiera's deep-merge with the 'merge_hash_arrays' option enabled - but even after enabling it using the lookup_options in my common.yaml file it is still not merging correctly. The 'lookup' calls in init.pp both force "merge = deep" which overrides any settings I make.
I'm not sure which is the better solution - but init.pp needs to be changed to either not specify a merge behavior so that the options defined in hiera lookup_options hash take effect, or to specify {'strategy' => 'deep', 'merge_hash_arrays' => true} The first method allows users to override the behavior if the choose, but is probably broken by default if they don't have lookup_options defined - the second will work by default, but forces it on everyone.
---
description: Install and configure telegraf
parameters:
targets:
type: TargetSpec
description: The targets to configure
steps:
- description: Install and configure telegraf
name: configure
targets: $targets
resources:
- class: telegraf
return: $configure
bolt plan run telegraf -t localhost
Failed on localhost:
Apply failed to compile for localhost: Class[Telegraf]:
parameter 'config_file_mode' expects a match for Stdlib::Filemode = Pattern[/\A(([0-7]{1,4})|(([ugoa]*([-+=]([rwxXst]*|[ugo]))+|[-+=][0-7]+)(,([ugoa]*([-+=]([rwxXst]*|[ugo]))+|[-+=][0-7]+))*))\z/], got Undef
parameter 'config_folder_mode' expects a match for Stdlib::Filemode = Pattern[/\A(([0-7]{1,4})|(([ugoa]*([-+=]([rwxXst]*|[ugo]))+|[-+=][0-7]+)(,([ugoa]*([-+=]([rwxXst]*|[ugo]))+|[-+=][0-7]+))*))\z/], got Undef (line: 4, column: 5)
Failed on 1 target: localhost
Hi, do you plan to implement multiple installation to have more than one telegraf running on the machine ?
Please review the following Agent Config options.
https://github.com/influxdata/telegraf/blob/master/CHANGELOG.md#v013-2016-05-11
metric_batch_size
should be addedflush_buffer_when_full
was removed in v0.13https://github.com/influxdata/telegraf/blob/master/CHANGELOG.md#v020-2015-10-27
precision
Not clear if this should be added or not. Changelog says it was moved from agent config, but it's generated when doing telegraf config
Agreeably this hurts the head to ponder, but seems it is a valid use case in eg [https://github.com/influxdata/telegraf/tree/master/plugins/inputs/postgresql_extensible]
If duplicates are specified as below, only the last is affected into the final configuration file
sections => {
'postgresql_extensible.query' => {
'sqlquery' => 'SELECT * FROM pg_stat_database where datname',
'version' => 901,
'withdbname' => true,
'tagvalue' => 'postgres'
},
'postgresql_extensible.query' => {
'sqlquery' => 'SELECT * FROM pg_stat_bgwriter where datname',
'version' => 901,
'withdbname' => true,
'tagvalue' => 'postgres'
},
}
If I change telegraf::ensure
in my configuration to specify a version, that version gets installed but the service doesn't restart.
Acceptance tests under Debian 8 and CentOS 7 based on containers running from official images are broken due to systemd-related problems, e.g on Debian:
Setting up telegraf (0.12.1-1) ...
Created symlink from /etc/systemd/system/telegraf.service to /lib/systemd/system/telegraf.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/telegraf.service to /lib/systemd/system/telegraf.service.
Failed to get D-Bus connection: Unknown error -1
Failed to get D-Bus connection: Unknown error -1
dpkg: error processing package telegraf (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
telegraf
E: Sub-process /usr/bin/dpkg returned an error code (1)
Warning: /Stage[main]/Telegraf::Config/File[/etc/telegraf/telegraf.conf]: Skipping because of failed dependencies
Warning: /Stage[main]/Telegraf::Service/Service[telegraf]: Skipping because of failed dependencies
Info: Creating state file /var/lib/puppet/state/state.yaml
Notice: Finished catalog run in 23.56 seconds
Tests timeout on CentOS 7 as starting SSH via service ssh start
is broken, e.g:
Attempting ssh connection to 192.168.172.236, user: root, opts: {:password=>"root", :port=>"32773", :forward_agent=>false}
Warning: Try 1 -- Host 192.168.172.236 unreachable: Errno::ECONNREFUSED - Connection refused - connect(2)
Warning: Trying again in 3 seconds
❯ docker logs happy_feynman
sh: service: command not found
Probably need to just run tests off more suitable images.
Hi everybody, is there already a plan to deprecate the old module on the forge (using the nice "new" deprecation function) and make a first release?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.