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

Working configuration example #2

Closed
simmel opened this issue Jun 1, 2021 · 3 comments
Closed

Working configuration example #2

simmel opened this issue Jun 1, 2021 · 3 comments

Comments

@simmel
Copy link
Contributor

simmel commented Jun 1, 2021

Hey!

Thanks for creating this, looks awesome!

I've been struggling to get it working the last couple of hours. I can't get it to change the default config.

This is the config I've been using:

LoadPlugin python
<Plugin python>
    ModulePath "/local/collectd/prom/lib/python2.7/site-packages"
    Import "collectd-prometheus"
    <Module "collectd-prometheus">
       Interval 5
       Protocol https
       SslIgnore True
       Port 2379
    </Module>
</Plugin>
systemd[1]: Starting Statistics collection and monitoring daemon...
[…]
collectd[29004]: plugin_load: plugin "python" successfully loaded.
collectd[29004]: Systemd detected, trying to signal readyness.
collectd[29004]: Initialization complete, entering read-loop.

and then nothing. Other metrics collected are sent fine, but not the prometheus-scraped ones.

I noticed that if I added the config:

       Process anythingreally

it started up but only using the default settings.

What am I doing wrong?

Thanks!

@ryarnyah
Copy link
Owner

ryarnyah commented Jun 1, 2021

Hey!

You need to have a <Process> child in your <Module> declaration, can you try this? It's design this way so you can monitor multiple process @see https://github.com/ryarnyah/collectd-prometheus/blob/master/collectd-prometheus.py#L85

LoadPlugin python
<Plugin python>
    ModulePath "/local/collectd/prom/lib/python2.7/site-packages"
    Import "collectd-prometheus"
    <Module "collectd-prometheus">
      Interval 5
      <Process>
         Process "{{ process.name }}"
         Protocol "https"
         SslIgnore True
         Port 2379
     </Process>
   </Module>
</Plugin>

@simmel
Copy link
Contributor Author

simmel commented Jun 2, 2021

Thank you! That worked!

I hope it's OK that I create a few PRs to improve the documentation?

@simmel simmel closed this as completed Jun 2, 2021
@ryarnyah
Copy link
Owner

ryarnyah commented Jun 2, 2021

Thank you! That worked!

I hope it's OK that I create a few PRs to improve the documentation?

With pleasure!

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