Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Puppet needs to run twice to apply CollectD configuration #900

Open
jcasals opened this issue Dec 16, 2019 · 3 comments
Open

Puppet needs to run twice to apply CollectD configuration #900

jcasals opened this issue Dec 16, 2019 · 3 comments

Comments

@jcasals
Copy link

jcasals commented Dec 16, 2019

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 4.10.10
  • Ruby: 2.0.0
  • Distribution: CentOS 7
  • Module version: 10.1.0 (puppet code written in hiera)

How to reproduce (e.g Puppet code you use)

classes:
    - collectd
    - collectd::plugin::cpu
    - collectd::plugin::df
    - collectd::plugin::disk
    - collectd::plugin::write_graphite
    - collectd::plugin::ipmi
    - collectd::plugin::interface
    - collectd::plugin::processes
    - collectd::plugin::users
    - collectd::plugin::swap
    - collectd::plugin::network

# global options
collectd::interval: 60

# cpu
collectd::plugin::cpu::reportbycpu: false
collectd::plugin::cpu::reportnumcpu: true

# df
collectd::plugin::df::reportinodes: false
collectd::plugin::df::mountpoints:
    - "/"
    - "/home"
    - "/tmp"

# writer to graphite
collectd::plugin::write_graphite::carbons:
  graphite:
    graphitehost: 'graphite.domain.es'
    graphiteport: 2013
    graphiteprefix: "collectd.Generic."
    separateinstances: false

# disk
collectd::plugin::disk::manage_package: false
collectd::plugin::disk::ignoreselected: false
collectd::plugin::disk::disks:
  - "vda"

# swap
collectd::plugin::swap::reportbydevice: false
collectd::plugin::swap::reportbytes: true
collectd::plugin::swap::reportio: false

# interface
collectd::plugin::interface::ignoreselected: false
collectd::plugin::interface::interfaces:
  - "%{::networking.primary}"

What are you seeing

I have been using your plugin to configure collectd to a cluster of around 700 hundred machines. Thank you for the plugin, it seems to work very well and make it very easy to setup.

I have been using it for a while but now I changed something and I realized the problem doing a fresh server installation, seeing something weird.
In the first run of puppet, it loads collectd, installs everything and loads plugins, applying some parts of the configuration in some files. Then, it doesn't apply most of the plugins specific configurations until I don't run puppet for the second time. I am not sure it is a problem with how I'm doing it, but my config is simple.

My main problem comes because I want the cpu plugin to group all cpus in one value, so it uses less disk space since we have some servers with several cpus, but if I have it one hour sending all the metrics for each cpu then the main purpose of the option to group metrics goes away.

I could create a cron that deletes all cpu-* directories, but doesn't look like the ideal option.

What behavior did you expect instead

Well, what I would expect is to write configuration directly in the first run but, again, this is just because I'm not sure if is caused by our configuration or not, but I don't see anything

Output log

This is the output for the first run, it installs everything specified in classes included in the top of the puppet yaml.
1st run
Here is the output of the second run of puppet where you can see the actual options of the CPU plugin (as an example) being added.
2nd run

Any additional information you'd like to impart

So, I think that's all, thank you so much,

Jordi

@Farfaday
Copy link

Hi,
We also are affected by this issue :)

@jcasals
Copy link
Author

jcasals commented Jan 2, 2020

Hello and happy new year 2020 to everyone.

Does anybody have or know a solution for this?

Thank you!

@Farfaday
Copy link

See https://github.com/voxpupuli/puppet-collectd#puppet-needs-two-runs-to-correctly-write-my-conf-why
So you can probably fix that issue by setting the minimum_version to something higher, like '5.8'.

Note: I set minimum_version to '5.8', but the issue still remain for the swap plugin (ReportIO gets added on the second run)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants