hectcastro / chef-collectd

A Chef cookbook to install collectd.
Apache License 2.0
23 stars 65 forks source link

plugin config doesn't support multiple LocalPort and RemotePort configurations for tcpconns plugin #56

Open kalebwalton opened 8 years ago

kalebwalton commented 8 years ago

I want to do this:

LoadPlugin tcpconns
<plugin tcpconns>
    LocalPort "80"
    LocalPort "443"
    LocalPort "25"
</plugin>

But for a plugin, the config is always converted into a hash, so it will only turn out 'LocalPort "80"' even if I include the others (or whatever the last one to make it into the hash is).

Is there another way?

jsirex commented 8 years ago

@kalebwalton , that's why I have to fork this cookbook. For such cases I had developed another way to define these via hash. It still buggy but works: https://github.com/jsirex/collectd-lib-cookbook

collectd_conf 'my-tcpconns' do
  plugin 'tcpconns'
  conf 'LocalPort' => [80, 443, 25]
end

Probably, someone will want to copy-paste this: https://github.com/jsirex/collectd-lib-cookbook/blob/master/libraries/chef_collectd_config_converter.rb partially