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

processes-config.conf file is not created #926

Closed
traylenator opened this issue Mar 23, 2020 · 10 comments · Fixed by #927
Closed

processes-config.conf file is not created #926

traylenator opened this issue Mar 23, 2020 · 10 comments · Fixed by #927
Labels
bug Something isn't working

Comments

@traylenator
Copy link
Contributor

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 6.14.0
  • Ruby:
  • Distribution: CentoS 7
  • Module version: 11.3.1-rc0
  • Collectd version 5.8.1

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

collectd::plugin::processes::processmatch{'eosd':
      collect_file_descriptor => true,
      collect_memory_maps     => true,
      collect_context_switch  => false,
      regex => 'eosd .*$',
    }

Apply manifest.

What are you seeing

The file /etc/collectd.d/processes-config.conf is not created.

What behaviour did you expect instead

The file should I think be created with, certainly the metrics are not enabled.

<Plugin processes>
      <ProcessMatch "eosd" "eosd .*$">
        CollectContextSwitch false
        CollectFileDescriptor true
        CollectMemoryMaps true
      </ProcessMatch>
    </Plugin>

Output log

Running puppet agent -d | grep Proces on above manifest.

 puppet apply /test.pp  -d  --color false | grep lugin::Proc    
Debug: Scope(Class[Collectd::Plugin::Processes]): Retrieving epp template collectd/plugin/processes-header.conf.epp
Debug: Scope(Collectd::Plugin::Processes::Processmatch[eosd]): Retrieving epp template collectd/plugin/processes/processmatch.conf.epp
Debug: /Stage[main]/Collectd::Plugin::Processes/Concat[/etc/collectd.d/processes-config.conf]/notify: notify to Service[collectd]
Debug: /Stage[main]/Collectd::Plugin::Processes/Collectd::Plugin[processes]/File[processes.load]/notify: notify to Service[collectd]
Debug: /Stage[main]/Collectd::Plugin::Processes/Collectd::Plugin[processes]/File[older_processes.load]/notify: notify to Service[collectd]
Debug: /Stage[main]/Collectd::Plugin::Processes/Collectd::Plugin[processes]/File[old_processes.load]/notify: notify to Service[collectd]
Debug: /Stage[main]/Collectd::Plugin::Processes/Collectd::Plugin[processes]/File[package_processes.load]/notify: notify to Service[collectd]
Debug: /Stage[main]/Collectd::Plugin::Processes/Concat[/etc/collectd.d/processes-config.conf]/Concat_file[/etc/collectd.d/processes-config.conf]/before: before to File[package_processes.load]
Debug: /Stage[main]/Collectd::Plugin::Processes/Collectd::Plugin[processes]/File[processes.load]: Adding autorequire relationship with File[collectd.d]
Debug: /Stage[main]/Collectd::Plugin::Processes/Collectd::Plugin[processes]/File[older_processes.load]: Adding autorequire relationship with File[collectd.d]
Debug: /Stage[main]/Collectd::Plugin::Processes/Collectd::Plugin[processes]/File[old_processes.load]: Adding autorequire relationship with File[collectd.d]
Debug: /Stage[main]/Collectd::Plugin::Processes/Collectd::Plugin[processes]/File[package_processes.load]: Adding autorequire relationship with File[collectd.d]
Debug: /Stage[main]/Collectd::Plugin::Processes/Concat[/etc/collectd.d/processes-config.conf]/Concat_file[/etc/collectd.d/processes-config.conf]: Skipping automatic relationship with File[package_processes.load]
Debug: /Stage[main]/Collectd::Plugin::Processes/Collectd::Plugin[processes]/File[older_processes.load]: Nothing to manage: no ensure and the resource doesn't exist
Debug: /Stage[main]/Collectd::Plugin::Processes/Collectd::Plugin[processes]/File[old_processes.load]: Nothing to manage: no ensure and the resource doesn't exist
Debug: /Stage[main]/Collectd::Plugin::Processes/Collectd::Plugin[processes]/File[package_processes.load]: Nothing to manage: no ensure and the resource doesn't exist

Any additional information you'd like to impart

Running a git bisect the behaviour changed with

a864d0d

@traylenator traylenator added the bug Something isn't working label Mar 23, 2020
@traylenator
Copy link
Contributor Author

Hi @paramite

Just deciding how best to fix this, maybe you have some comment?

  • I see either just change the configuration name that puppet creates away from processes-config.conf
  • Migrate to 10-proceses.conf to be a concat , stick the fragments in there and then
    we only have one file for for plugin which is more beatiful I think. But changing collectd::plugin
    has quite some consquences.

@traylenator
Copy link
Contributor Author

traylenator commented Mar 24, 2020

The fact that

concat{'/tmp/file':
  ensure => present,
}
concat::fragment{'a snippet':
  content => 'foo',
  target  => '/tmp/file',
}

file{'/tmp/file':
  ensure => absent,
}

is a valid manifest and does not give a compile error is really undesirable.

The above currently purges the file.

@alexjfisher
Copy link
Member

alexjfisher commented Mar 24, 2020

This isn't much different to how a file_line resource and file resource can conflict though?

traylenator added a commit to traylenator/puppet-collectd that referenced this issue Mar 24, 2020
There was a name clash between:
* Puppet created configuration file.
* Package provided configuration file.

Since a864d0d the collectd module on RedHat
purges the package provided file file `/etc/collectd.d/processes-config.conf`

The module was also creating this file with a concat and result was no
file on system.

To avoid the clash puppet now creates the file `processes_config.conf`. Note
the `-` vs `_`.

There is probably a cleaner fix to move all of the processes plugin configuration
into the per module file `/etc/collect.d/10-processses.conf` as that would
be more consistant with other simpler modules. This would be a change
for every module however with `collectd::plugin` itself changing.

Fixes voxpupuli#926
traylenator added a commit to traylenator/puppet-collectd that referenced this issue Mar 24, 2020
There was a name clash between:
* Puppet created configuration file.
* Package provided configuration file.

Since a864d0d the collectd module on RedHat
purges the package provided file file `/etc/collectd.d/processes-config.conf`

The module was also creating this file with a concat and result was no
file on system.

To avoid the clash puppet now creates the file `processes_config.conf`. Note
the `-` vs `_`.

There is probably a cleaner fix to move all of the processes plugin configuration
into the per module file `/etc/collect.d/10-processses.conf` as that would
be more consistant with other simpler modules. This would be a change
for every module however with `collectd::plugin` itself changing.

Fixes voxpupuli#926
traylenator added a commit to traylenator/puppet-collectd that referenced this issue Mar 24, 2020
There was a name clash between:
* Puppet created configuration file.
* Package provided configuration file which was being purged.

Since a864d0d the collectd module on RedHat
purges the package provided file file `/etc/collectd.d/processes-config.conf`

The module was also creating this file with a concat and result was no
file on system.

To avoid the clash puppet now creates the file `processes_config.conf`. Note
the `-` vs `_`.

There is probably a cleaner fix to move all of the processes plugin configuration
into the per module file `/etc/collect.d/10-processses.conf` as that would
be more consistant with other simpler modules using a single template
rather than a concat. This would be a change for every module
however with `collectd::plugin` itself changing.

Fixes voxpupuli#926
@traylenator
Copy link
Contributor Author

This isn't much different to how a file_line resource and file resource can conflict though?

I think you normally at least see puppet apply doing something in this case, you get an oscillation. With the above there is zero change when puppet apply so long as the file is not there.
Not sure anything can be done, its just easy to fall into.

traylenator added a commit to traylenator/puppet-collectd that referenced this issue Mar 24, 2020
There was a name clash between:
* Puppet created configuration file.
* Package provided configuration file which was being purged.

Since a864d0d the collectd module on RedHat
purges the package provided file file `/etc/collectd.d/processes-config.conf`

The module was also creating this file with a concat and result was no
file on system.

To avoid the clash puppet now creates the file `processes_config.conf`. Note
the `-` vs `_`.

There is probably a cleaner fix to move all of the processes plugin configuration
into the per module file `/etc/collect.d/10-processses.conf` as that would
be more consistant with other simpler modules using a single template
rather than a concat. This would be a change for every module
however with `collectd::plugin` itself changing.

Fixes voxpupuli#926
traylenator added a commit to traylenator/puppet-collectd that referenced this issue Mar 24, 2020
There was a name clash between:
* Puppet created configuration file.
* Package provided configuration file which was being purged.

Since a864d0d the collectd module on RedHat
purges the package provided file file `/etc/collectd.d/processes-config.conf`

The module was also creating this file with a concat and result was no
file on system.

To avoid the clash puppet now creates the file `processes_config.conf`. Note
the `-` vs `_`.

There is probably a cleaner fix to move all of the processes plugin configuration
into the per module file `/etc/collect.d/10-processses.conf` as that would
be more consistant with other simpler modules using a single template
rather than a concat. This would be a change for every module
however with `collectd::plugin` itself changing.

Fixes voxpupuli#926
traylenator added a commit to traylenator/puppet-collectd that referenced this issue Mar 24, 2020
There was a name clash between:
* Puppet created configuration file.
* Package provided configuration file which was being purged.

Since a864d0d the collectd module on RedHat
purges the package provided file file `/etc/collectd.d/processes-config.conf`

The module was also creating this file with a concat and result was no
file on system.

To avoid the clash puppet now creates the file `processes_config.conf`. Note
the `-` vs `_`.

There is probably a cleaner fix to move all of the processes plugin configuration
into the per module file `/etc/collect.d/10-processses.conf` as that would
be more consistant with other simpler modules using a single template
rather than a concat. This would be a change for every module
however with `collectd::plugin` itself changing.

Fixes voxpupuli#926
traylenator added a commit to traylenator/puppet-collectd that referenced this issue Mar 24, 2020
There was a name clash between:
* Puppet created configuration file.
* Package provided configuration file which was being purged.

Since a864d0d the collectd module on RedHat
purges the package provided file file `/etc/collectd.d/processes-config.conf`

The module was also creating this file with a concat and result was no
file on system.

To avoid the clash puppet now creates the file `processes_config.conf`. Note
the `-` vs `_`.

There is probably a cleaner fix to move all of the processes plugin configuration
into the per module file `/etc/collect.d/10-processses.conf` as that would
be more consistant with other simpler modules using a single template
rather than a concat. This would be a change for every module
however with `collectd::plugin` itself changing.

Fixes voxpupuli#926
@paramite
Copy link
Contributor

I don't understand what is wrong here. IIUC to have the processes-config.conf created you need to use collectd::plugin::processes with appropriate process_matches value, which IIUC you did not use, so it is kind of expected that the config is not created.

@traylenator
Copy link
Contributor Author

I don't understand what is wrong here. IIUC to have the processes-config.conf created you need to use collectd::plugin::processes with appropriate process_matches value, which IIUC you did not use, so it is kind of expected that the config is not created.

Even with process_matches values then processes-config.conf is created as a concat file
but the file resource of absent wins the day.

@paramite
Copy link
Contributor

Ah got it. So where does the file resource with absent comes from?

@traylenator
Copy link
Contributor Author

From the commit above: a864d0d

it was added to stop default files form packages interfering.

traylenator added a commit to traylenator/puppet-collectd that referenced this issue Mar 25, 2020
There was a name clash between:
* Puppet created configuration file.
* Package provided configuration file which was being purged.

Since a864d0d the collectd module on RedHat
purges the package provided file file `/etc/collectd.d/processes-config.conf`

The module was also creating this file with a concat and result was no
file on system.

To avoid the clash puppet now creates the file `processes_config.conf`. Note
the `-` vs `_`.

There is probably a cleaner fix to move all of the processes plugin configuration
into the per module file `/etc/collect.d/10-processses.conf` as that would
be more consistant with other simpler modules using a single template
rather than a concat. This would be a change for every module
however with `collectd::plugin` itself changing.

Fixes voxpupuli#926
@paramite
Copy link
Contributor

@traylenator: Ah, now I understand why you pinged me regarding this :). So if we want to have the processes plugin config name consistent with the rest, then yes rename to something like -processes.conf should be a solution. If we want to keep the name, then probably adding require => File['package_processes.load'] (in combination with defined(File['package_processes.load'])) to the concat and fragments resources should also work, right? I'm not core in this project, so maybe @alexjfisher will show the correct path we should go?

@traylenator
Copy link
Contributor Author

The fix I prefer to this problem of package config vs puppet config is just to avoid the problem and
use say /etc/collectd-puppet/conf.d and ignore the contents of /etc/collectd.d . Works well but a little non standard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants