Giter VIP home page Giter VIP logo

collectd-formula's Introduction

collectd-formula

Travis CI Build Status Documentation Status Semantic Release

A SaltStack formula that installs and configures collectd. The system statistics collection daemon. start on a new formula and it serves as a style guide.

See the full SaltStack Formulas installation and usage instructions.

If you are interested in writing or contributing to formulas, please pay attention to the Writing Formula Section.

If you want to use this formula, please pay attention to the FORMULA file and/or git tag, which contains the currently released version. This formula is versioned according to Semantic Versioning.

See Formula Versioning Section for more details.

Commit message formatting is significant!!

Please see How to contribute for more details.

Meta-state (This is a state that includes other states).

Installs the collectd package, and starts the associated collectd service.

Metastate used to include service into respective plugin states, included in collectd state.

Enables and configures the apache plugin. All common parameters are supported, so pass something like

apache:
  instances:
    - name: 'human-readable-name'
      url: 'http://localhost/server-status?auto'
      user: 'user'
      pass: 'your-password'

Only name and url are required.

Enables and configures the bind plugin.

Enables and configures the dbi plugin. It's used for quering databases with libdbi. Refer to collectd.conf(5) manpage for details and pillar.example to see how values should be populated.

Beware this plugin may need additional packages installed on your system to run properly.

Enables and configures the csv write plugin.

Enables and configures the df plugin.

Enables and configures the disk plugin.

Enables and configures the elasticsearch plugin

Enables and configures the ethstat plugin (please note there is a possible bug in the debian package).

Enables and configures the interface plugin.

Enables and configures the java plugin. If enabled it will also collect tomcat catalina metrics.

Requires the installation of JDK.

Pillar values used under collectd.plugins.java, an example

collectd:
  plugins:
    java:
      host: localhost
      port: 39999
      user: 'someuser' (optional)
      group: 'someuser' (optional)
      lib: '/some/file' (optional)
      tomcat: true (optional)

Enables and configures the logfile plugin.

This state helps distributing collectd external modules written in various languages (see python or perl for example).

Sample usage:

  • Include collectd.modules in your topfile.
  • Create collectd/modules/files folder in your states.
  • Put modules you need in that folder.
  • Modules will be put in collectd.moduledirconfig folder.

Enables and configures the mysql plugin. Needs refinement.

Enables and configures the network plugin.

Enables and configures the ntpd plugin.

This state is used to install OS packages collectd plugins depend on.

Enables and configures the postgresql plugin. Needs refinement.

Enables and configures the processes plugin

Enables and configures the protocols plugin

Enables and configures the powerdns plugin.

Enables and configures the rabbitmq plugin.

Enables and configures the redis plugin.

Enables and configures the syslog plugin.

Enables and configures the tail plugin.

Enables and configures the tcpconns plugin.

Manages a TypesDB file stored at plugindirconfig/types.db.

Enables and configures the curl_json plugin.

Enables and configures the curl_xml plugin.

Enables and configures the python plugin, which allows executiong arbitrary python scripts.

Enables and configures the vmem plugin.

Enables and configures write_http plugin for reporting to Librato

Enables and configures the zookeeper plugin.

Enables and configures the unixsock plugin.

Create a custom state file (for example collectd-custom.sls) that includes the plugins you want and the base state.

include:
  - collectd
  - collectd.disk
  - collectd.syslog

Then in your topfile:

'servername':
  - collectd-custom

Or if you don't mind having long lists in your topfile, just add whatever plugins you want and the base state.

'servername':
  - collectd
  - collectd.disk
  - collectd.syslog

Or you can combine both - default plugins in custom state and specific in topfile.

'apache-server':
  - collectd-custom
  - collectd.apache

collectd-formula's People

Contributors

aboe76 avatar badele avatar bdols avatar bogdanr avatar dafyddj avatar daks avatar dosercz avatar fintanmm avatar genuss avatar gravyboat avatar grumpydude avatar hexedpackets avatar iggy avatar jettero avatar johnkeates avatar junovitch avatar kaidokert avatar kpostrup avatar multani avatar myii avatar n-rodriguez avatar nmadhok avatar puckel avatar puneetk avatar roedie avatar sawasy avatar semantic-release-bot avatar tomasfejfar avatar whiteinge avatar wwentland avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

collectd-formula's Issues

Time to port all new standards from template-formula (versioning, docs...)?

collectd-formula is a quite simple formula, very stable (most of last changes concerns adding plugins or improving doc), and now that tests are implemented (or should be soon) I think it could be nice to 'upgrade' it to the last standards implemented in template-formula.
I'm mostly thinking about versioning and docs which are, I think, simple to port. (TOFS for example is most time-consuming)

What do you think about this idea?

  • semantic-release
  • docs
  • TOFS
  • config.get

collectd.java needs more flexibility

Just started to use java plugin of collectd and found out that this formula provides only basic configuring.
Would't you mind if I rewrite the collectd.java state to support many LoadPlugin options with comprehensive configuration of them?
The only downside I see is that I can't provide backwards-compatibilty.

collectd.java fails with default values

Trying to use collectd.java on Debian results in the following error:

----------
          ID: /usr/lib/collectd/java.so
    Function: file.symlink
      Result: False
     Comment: File exists where the symlink /usr/lib/collectd/java.so should be
     Started: 10:12:11.219063
    Duration: 0.721 ms
     Changes: 

It would be muich appreciated if this insanity could be fixed in such a way that the formula works with the default settings.

collectd.java allows only single java application to graph

Right now it is only possible to define Connection in java.con. This means e.g if you running zk and Kafka on same node you can't graph both applications.

Current Setup:

pillar.example
collectd:
  javalib: /opt/java/jre/lib/amd64/libjava.so
  plugins:
    java:
      jvmargs:
        - "-verbose:jni"
        - "-Djava.class.path=/usr/share/collectd/java/collectd-api.jar:/usr/share/collectd/java/generic-jmx.jar"
      host: {{ grains['id'] }}
      port: 28181


/etc/collectd.d/java.conf
    <Connection>
      ServiceURL "service:jmx:rmi:///jndi/rmi://example.host.com:28181/jmxrmi"
      Host "example.host.com"
      Collect "classes"
      Collect "compilation"
      Collect "garbage_collector"
      Collect "memory"
      Collect "memory_pool"
    </Connection>

Expected Setup:

pillar.example
collectd:
  javalib: /opt/java/jre/lib/amd64/libjava.so
  plugins:
    java:
      jvmargs:
        - "-verbose:jni"
        - "-Djava.class.path=/usr/share/collectd/java/collectd-api.jar:/usr/share/collectd/java/generic-jmx.jar"
      app1:
        host: {{ grains['id'] }}
        InstancePrefix "app1-"
        port: 28181
      app2:
        host: {{ grains['id'] }}
        InstancePrefix "app2-"
        port: 9999

/etc/collectd.d/java.conf
    <Connection>
      ServiceURL "service:jmx:rmi:///jndi/rmi://example.host.com:28181/jmxrmi"
      Host "example.host.com"
      InstancePrefix "app1-"
      Collect "classes"
      Collect "compilation"
      Collect "garbage_collector"
      Collect "memory"
      Collect "memory_pool"
    </Connection>
    <Connection>
      ServiceURL "service:jmx:rmi:///jndi/rmi://example.host.com:9999/jmxrmi"
      Host "example.host.com"
      InstancePrefix "app2-"
      Collect "classes"
      Collect "compilation"
      Collect "garbage_collector"
      Collect "memory"
      Collect "memory_pool"
    </Connection>

This formula does not work with salt-ssh

Your setup

Formula commit hash / release tag

v1.2.1

Versions reports (master & minion)

salt --versions-report
Salt Version:
          Salt: 3005.1
 
Dependency Versions:
          cffi: Not Installed
      cherrypy: Not Installed
      dateutil: 2.8.2
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.0.3
       libgit2: 1.5.0
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.3
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     pycparser: Not Installed
      pycrypto: Not Installed
  pycryptodome: 3.11.0
        pygit2: 1.11.1
        Python: 3.10.9 (main, Dec  7 2022, 13:47:07) [GCC 12.2.0]
  python-gnupg: Not Installed
        PyYAML: 6.0
         PyZMQ: 24.0.1
         smmap: Not Installed
       timelib: Not Installed
       Tornado: 4.5.3
           ZMQ: 4.3.4
 
System Versions:
          dist: debian n/a bookworm
        locale: utf-8
       machine: x86_64
       release: 6.0.0-6-amd64
        system: Linux
       version: Debian GNU/Linux n/a bookworm

Pillar / config used

None


Bug details

Describe the bug

When I try to run collectd.disk with salt-ssh, I get a jinja2.exceptions.TemplateNotFound: collectd/map.jinja

Steps to reproduce the bug

salt-ssh 'vm-106' state.apply collectd.disk test=True
vm-106:
----------
          ID: collectd
    Function: pkg.installed
        Name: collectd-core
      Result: None
     Comment: The following packages would be installed/updated: collectd-core
     Started: 08:49:48.652548
    Duration: 67.392 ms
     Changes:   
              ----------
              collectd-core:
                  ----------
                  new:
                      installed
                  old:
----------
          ID: /etc/collectd/plugins
    Function: file.directory
      Result: None
     Comment: The following files will be changed:
              /etc/collectd/plugins: directory - new
     Started: 08:49:48.723995
    Duration: 5.262 ms
     Changes:   
              ----------
              /etc/collectd/plugins:
                  ----------
                  directory:
                      new
----------
          ID: /etc/collectd/plugins/disk.conf
    Function: file.managed
      Result: False
     Comment: An exception occurred in this state: Traceback (most recent call last):
                File "/var/tmp/.root_8dccac_salt/pyall/salt/utils/templates.py", line 469, in render_jinja_tmpl
                  output = template.render(**decoded_context)
                File "/var/tmp/.root_8dccac_salt/pyall/jinja2/environment.py", line 1291, in render
                  self.environment.handle_exception()
                File "/var/tmp/.root_8dccac_salt/pyall/jinja2/environment.py", line 925, in handle_exception
                  raise rewrite_traceback_stack(source=source)
                File "<template>", line 1, in top-level template code
                File "/var/tmp/.root_8dccac_salt/pyall/salt/utils/jinja.py", line 221, in get_source
                  raise TemplateNotFound(template)
              jinja2.exceptions.TemplateNotFound: collectd/map.jinja
              
              During handling of the above exception, another exception occurred:
              
              Traceback (most recent call last):
                File "/var/tmp/.root_8dccac_salt/pyall/salt/state.py", line 2276, in call
                  ret = self.states[cdata["full"]](
                File "/var/tmp/.root_8dccac_salt/pyall/salt/loader/lazy.py", line 149, in __call__
                  return self.loader.run(run_func, *args, **kwargs)
                File "/var/tmp/.root_8dccac_salt/pyall/salt/loader/lazy.py", line 1228, in run
                  return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
                File "/var/tmp/.root_8dccac_salt/pyall/salt/loader/lazy.py", line 1243, in _run_as
                  return _func_or_method(*args, **kwargs)
                File "/var/tmp/.root_8dccac_salt/pyall/salt/loader/lazy.py", line 1276, in wrapper
                  return f(*args, **kwargs)
                File "/var/tmp/.root_8dccac_salt/pyall/salt/states/file.py", line 3100, in managed
                  ret["changes"] = __salt__["file.check_managed_changes"](
                File "/var/tmp/.root_8dccac_salt/pyall/salt/loader/lazy.py", line 149, in __call__
                  return self.loader.run(run_func, *args, **kwargs)
                File "/var/tmp/.root_8dccac_salt/pyall/salt/loader/lazy.py", line 1228, in run
                  return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
                File "/var/tmp/.root_8dccac_salt/pyall/salt/loader/lazy.py", line 1243, in _run_as
                  return _func_or_method(*args, **kwargs)
                File "/var/tmp/.root_8dccac_salt/pyall/salt/modules/file.py", line 5475, in check_managed_changes
                  sfn, source_sum, comments = get_managed(
                File "/var/tmp/.root_8dccac_salt/pyall/salt/modules/file.py", line 4713, in get_managed
                  data = salt.utils.templates.TEMPLATE_REGISTRY[template](
                File "/var/tmp/.root_8dccac_salt/pyall/salt/utils/templates.py", line 216, in render_tmpl
                  output = render_str(tmplstr, context, tmplpath)
                File "/var/tmp/.root_8dccac_salt/pyall/salt/utils/templates.py", line 513, in render_jinja_tmpl
                  raise SaltRenderError(
              salt.exceptions.SaltRenderError: Jinja error: collectd/map.jinja
              Traceback (most recent call last):
                File "/var/tmp/.root_8dccac_salt/pyall/salt/utils/templates.py", line 469, in render_jinja_tmpl
                  output = template.render(**decoded_context)
                File "/var/tmp/.root_8dccac_salt/pyall/jinja2/environment.py", line 1291, in render
                  self.environment.handle_exception()
                File "/var/tmp/.root_8dccac_salt/pyall/jinja2/environment.py", line 925, in handle_exception
                  raise rewrite_traceback_stack(source=source)
                File "<template>", line 1, in top-level template code
                File "/var/tmp/.root_8dccac_salt/pyall/salt/utils/jinja.py", line 221, in get_source
                  raise TemplateNotFound(template)
              jinja2.exceptions.TemplateNotFound: collectd/map.jinja
              
              ; line 1
              
              ---
              {%- from "collectd/map.jinja" import collectd_settings with context %}    <======================
              #
              # DO NOT EDIT
              #
              # This file is managed by salt via {{ source }}
              # Modify the config that generates this file instead
              [...]
              ---
     Started: 08:49:48.729393
    Duration: 56.021 ms
     Changes:   
----------
          ID: /etc/collectd/collectd.conf
    Function: file.managed
      Result: False
     Comment: An exception occurred in this state: Traceback (most recent call last):
                File "/var/tmp/.root_8dccac_salt/pyall/salt/utils/templates.py", line 469, in render_jinja_tmpl
                  output = template.render(**decoded_context)
                File "/var/tmp/.root_8dccac_salt/pyall/jinja2/environment.py", line 1291, in render
                  self.environment.handle_exception()
                File "/var/tmp/.root_8dccac_salt/pyall/jinja2/environment.py", line 925, in handle_exception
                  raise rewrite_traceback_stack(source=source)
                File "<template>", line 1, in top-level template code
                File "/var/tmp/.root_8dccac_salt/pyall/salt/utils/jinja.py", line 221, in get_source
                  raise TemplateNotFound(template)
              jinja2.exceptions.TemplateNotFound: collectd/map.jinja
              
              During handling of the above exception, another exception occurred:
              
              Traceback (most recent call last):
                File "/var/tmp/.root_8dccac_salt/pyall/salt/state.py", line 2276, in call
                  ret = self.states[cdata["full"]](
                File "/var/tmp/.root_8dccac_salt/pyall/salt/loader/lazy.py", line 149, in __call__
                  return self.loader.run(run_func, *args, **kwargs)
                File "/var/tmp/.root_8dccac_salt/pyall/salt/loader/lazy.py", line 1228, in run
                  return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
                File "/var/tmp/.root_8dccac_salt/pyall/salt/loader/lazy.py", line 1243, in _run_as
                  return _func_or_method(*args, **kwargs)
                File "/var/tmp/.root_8dccac_salt/pyall/salt/loader/lazy.py", line 1276, in wrapper
                  return f(*args, **kwargs)
                File "/var/tmp/.root_8dccac_salt/pyall/salt/states/file.py", line 3100, in managed
                  ret["changes"] = __salt__["file.check_managed_changes"](
                File "/var/tmp/.root_8dccac_salt/pyall/salt/loader/lazy.py", line 149, in __call__
                  return self.loader.run(run_func, *args, **kwargs)
                File "/var/tmp/.root_8dccac_salt/pyall/salt/loader/lazy.py", line 1228, in run
                  return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
                File "/var/tmp/.root_8dccac_salt/pyall/salt/loader/lazy.py", line 1243, in _run_as
                  return _func_or_method(*args, **kwargs)
                File "/var/tmp/.root_8dccac_salt/pyall/salt/modules/file.py", line 5475, in check_managed_changes
                  sfn, source_sum, comments = get_managed(
                File "/var/tmp/.root_8dccac_salt/pyall/salt/modules/file.py", line 4713, in get_managed
                  data = salt.utils.templates.TEMPLATE_REGISTRY[template](
                File "/var/tmp/.root_8dccac_salt/pyall/salt/utils/templates.py", line 216, in render_tmpl
                  output = render_str(tmplstr, context, tmplpath)
                File "/var/tmp/.root_8dccac_salt/pyall/salt/utils/templates.py", line 513, in render_jinja_tmpl
                  raise SaltRenderError(
              salt.exceptions.SaltRenderError: Jinja error: collectd/map.jinja
              Traceback (most recent call last):
                File "/var/tmp/.root_8dccac_salt/pyall/salt/utils/templates.py", line 469, in render_jinja_tmpl
                  output = template.render(**decoded_context)
                File "/var/tmp/.root_8dccac_salt/pyall/jinja2/environment.py", line 1291, in render
                  self.environment.handle_exception()
                File "/var/tmp/.root_8dccac_salt/pyall/jinja2/environment.py", line 925, in handle_exception
                  raise rewrite_traceback_stack(source=source)
                File "<template>", line 1, in top-level template code
                File "/var/tmp/.root_8dccac_salt/pyall/salt/utils/jinja.py", line 221, in get_source
                  raise TemplateNotFound(template)
              jinja2.exceptions.TemplateNotFound: collectd/map.jinja
              
              ; line 1
              
              ---
              {%- from "collectd/map.jinja" import collectd_settings with context %}    <======================
              #
              # DO NOT EDIT
              #
              # This file is managed by salt via {{ source }}
              # Modify the config that generates this file instead
              [...]
              ---
     Started: 08:49:48.785568
    Duration: 7.819 ms
     Changes:   
----------
          ID: /etc/collectd/plugins/default.conf
    Function: file.managed
      Result: False
     Comment: An exception occurred in this state: Traceback (most recent call last):
                File "/var/tmp/.root_8dccac_salt/pyall/salt/utils/templates.py", line 469, in render_jinja_tmpl
                  output = template.render(**decoded_context)
                File "/var/tmp/.root_8dccac_salt/pyall/jinja2/environment.py", line 1291, in render
                  self.environment.handle_exception()
                File "/var/tmp/.root_8dccac_salt/pyall/jinja2/environment.py", line 925, in handle_exception
                  raise rewrite_traceback_stack(source=source)
                File "<template>", line 1, in top-level template code
                File "/var/tmp/.root_8dccac_salt/pyall/salt/utils/jinja.py", line 221, in get_source
                  raise TemplateNotFound(template)
              jinja2.exceptions.TemplateNotFound: collectd/map.jinja
              
              During handling of the above exception, another exception occurred:
              
              Traceback (most recent call last):
                File "/var/tmp/.root_8dccac_salt/pyall/salt/state.py", line 2276, in call
                  ret = self.states[cdata["full"]](
                File "/var/tmp/.root_8dccac_salt/pyall/salt/loader/lazy.py", line 149, in __call__
                  return self.loader.run(run_func, *args, **kwargs)
                File "/var/tmp/.root_8dccac_salt/pyall/salt/loader/lazy.py", line 1228, in run
                  return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
                File "/var/tmp/.root_8dccac_salt/pyall/salt/loader/lazy.py", line 1243, in _run_as
                  return _func_or_method(*args, **kwargs)
                File "/var/tmp/.root_8dccac_salt/pyall/salt/loader/lazy.py", line 1276, in wrapper
                  return f(*args, **kwargs)
                File "/var/tmp/.root_8dccac_salt/pyall/salt/states/file.py", line 3100, in managed
                  ret["changes"] = __salt__["file.check_managed_changes"](
                File "/var/tmp/.root_8dccac_salt/pyall/salt/loader/lazy.py", line 149, in __call__
                  return self.loader.run(run_func, *args, **kwargs)
                File "/var/tmp/.root_8dccac_salt/pyall/salt/loader/lazy.py", line 1228, in run
                  return self._last_context.run(self._run_as, _func_or_method, *args, **kwargs)
                File "/var/tmp/.root_8dccac_salt/pyall/salt/loader/lazy.py", line 1243, in _run_as
                  return _func_or_method(*args, **kwargs)
                File "/var/tmp/.root_8dccac_salt/pyall/salt/modules/file.py", line 5475, in check_managed_changes
                  sfn, source_sum, comments = get_managed(
                File "/var/tmp/.root_8dccac_salt/pyall/salt/modules/file.py", line 4713, in get_managed
                  data = salt.utils.templates.TEMPLATE_REGISTRY[template](
                File "/var/tmp/.root_8dccac_salt/pyall/salt/utils/templates.py", line 216, in render_tmpl
                  output = render_str(tmplstr, context, tmplpath)
                File "/var/tmp/.root_8dccac_salt/pyall/salt/utils/templates.py", line 513, in render_jinja_tmpl
                  raise SaltRenderError(
              salt.exceptions.SaltRenderError: Jinja error: collectd/map.jinja
              Traceback (most recent call last):
                File "/var/tmp/.root_8dccac_salt/pyall/salt/utils/templates.py", line 469, in render_jinja_tmpl
                  output = template.render(**decoded_context)
                File "/var/tmp/.root_8dccac_salt/pyall/jinja2/environment.py", line 1291, in render
                  self.environment.handle_exception()
                File "/var/tmp/.root_8dccac_salt/pyall/jinja2/environment.py", line 925, in handle_exception
                  raise rewrite_traceback_stack(source=source)
                File "<template>", line 1, in top-level template code
                File "/var/tmp/.root_8dccac_salt/pyall/salt/utils/jinja.py", line 221, in get_source
                  raise TemplateNotFound(template)
              jinja2.exceptions.TemplateNotFound: collectd/map.jinja
              
              ; line 1
              
              ---
              {%- from "collectd/map.jinja" import collectd_settings with context %}    <======================
              #
              # DO NOT EDIT
              #
              # This file is managed by salt via {{ source }}
              # Modify the config that generates this file instead
              [...]
              ---
     Started: 08:49:48.793519
    Duration: 6.003 ms
     Changes:   
----------
          ID: collectd-service
    Function: service.running
        Name: collectd
      Result: False
     Comment: One or more requisite failed: collectd./etc/collectd/plugins/default.conf, collectd./etc/collectd/collectd.conf, collectd.disk./etc/collectd/plugins/disk.conf
     Started: 08:49:48.810224
    Duration: 0.005 ms
     Changes:   

Summary for vm-106
------------
Succeeded: 2 (unchanged=2, changed=2)
Failed:    4
------------
Total states run:     6
Total run time: 142.502 ms

Expected behaviour

The state show run without any error

Attempts to fix the bug

As mentioned in 21370, a workaround is to create a new state to cache include and import files.

I'll submit a PR to workaround that bug.

Additional context

[BUG] libpq.so.5 postgresql module is missing

When we include the collectd.postgresql state, the service launch fails because of the missing libpq.so.5 module with this error message on debian-10 platform:

To reproduce the error :

  • Add on kitchen.yml

      state_top:
        base:
          '*':
            .....
            - collectd.postgresql 
  • Run

$ kitchen converge default-debian-10-tiamat-py3

Error on converge :

       ----------
                 ID: collectd-service
           Function: service.running
               Name: collectd
             Result: False
            Comment: Job for collectd.service failed because the control process exited with error code.
              See "systemctl status collectd.service" and "journalctl -xe" for details.
            Started: 14:31:09.789580
           Duration: 47.465 ms
            Changes:   

Debug :

$ kitchen login default-debian-10-tiamat-py3

We can find on the journalctl the error in details :


Apr 25 14:31:55 0397fcc4b0a3 collectd[662]: dlopen ("/usr/lib/collectd/postgresql.so") failed: libpq.so.5: cannot open shared object file: No such file or directory. The most common cause for this problem is missing dependencies. Use ldd(1) to check the dependencies of the plugin / shared object.
Apr 25 14:31:55 0397fcc4b0a3 collectd[662]: plugin_load: Load plugin "postgresql" failed with status 1.
Apr 25 14:31:55 0397fcc4b0a3 collectd[662]: Error: Reading the config file failed!
Apr 25 14:31:55 0397fcc4b0a3 collectd[662]: Read the logs for details.
Apr 25 14:31:55 0397fcc4b0a3 systemd[1]: collectd.service: Main process exited, code=exited, status=1/FAILURE
Apr 25 14:31:55 0397fcc4b0a3 systemd[1]: collectd.service: Failed with result 'exit-code'.
Apr 25 14:31:55 0397fcc4b0a3 systemd[1]: Failed to start Statistics collection and monitoring daemon.
Apr 25 14:31:55 0397fcc4b0a3 systemd[1]: collectd.service: Consumed 5ms CPU time.
....
....

The solution I could find would be to install the required dependency by:

sudo apt-get install libpq-dev

It would therefore be necessary to add this dependency in the postgresql modules to be installed if we want to use the state collectd.postgresql

is there a generic way to handle other plugins?

Hello,

I want to use a plugin which seems to not be managed by this formula: the sensors one https://collectd.org/wiki/index.php/Plugin:Sensors.
And I wonder if there is a generic way to handle this type of plugins, which are not explicitly managed by the formula? (I couldn''t find it)

For now, I think I'll just 'extend' the formula, but if it's feasible it could be interesting to have a generic way to do it, which could possibly manage the <plugindirconfig>/<plugin>.conf file and its parameters.

Thanks.

Option to clean the plugins configuration directory (plugindirconfig)

Hello,
trying this formula, and doing a lot of tests, it appears that it does not clean automatically the plugindirconfig (/etc/collectd/plugins on Debian). The consequence is if I remove a plugin, the file stays and collectd still uses it.
I think it could be interesting to tell to Salt to only let managed files and remove others.
Could this be an option?

Thanks.

plugin processes: mismatch between implementation and pillar.example

To configure plugin processes, pillar.example give this example

collectd:
  plugins:
    processes:
      - java
      - python

But it does not work like this. When reading collectd/files/processes.conf we see it expects keys Processes and ProcessesMatch.

Event if I don't like this syntax (key names with Capital) and it's not homogenous (most plugins use pillar data with key names in lowercase), it seems that this syntax exists since 2015, so we just need to make pillar.example correct.

collectd.javalib is not set for RedHat

collectd/java.sls contains the following block:

{% from "collectd/map.jinja" import collectd with context %}                     

include:                                                                         
  - collectd  

collectd-java:                                                                   
    file.rename:                                                                 
        - name: {{ collectd.javalib }}                                           
        - source: {{ collectd.javalib }}.new                                     
        - force: False                                                           
        - makedirs: False                                                        

{{ collectd.javalib }}:                                                          
    file.symlink:                                                                
        - target: {{ salt['pillar.get']('collectd:plugins:java:lib') }}          
        - makedirs: False  

which requires collectd.javalib to be defined in the collectd map in map.jinja. Closer inspection reveals the following:

{% set collectd = salt['grains.filter_by']({                                     
    'Debian': {                                                                  
        'pkg': 'collectd-core',                                                  
        'service': 'collectd',                                                   
        'config': '/etc/collectd/collectd.conf',                                 
        'plugindirconfig': '/etc/collectd/plugins',                              
        'javalib': '/usr/lib/collectd/java.so',                                  
    },                                                                           
    'RedHat': {                                                                  
        'pkg': 'collectd',                                                       
        'service': 'collectd',                                                   
        'config': '/etc/collectd.conf',                                                                                
        'plugindirconfig': '/etc/collectd.d',                                    
    },                                                                           
}, merge=salt['pillar.get']('collectd:lookup')) %} 

where you can easily see that javalib has only been defined for Debian (which causes #26) but not RedHat. This is, obviously, rather suboptimal.

It is also not clear at all why one can't use the collectd java plugin with the default java library by default and why this whole symlinking is needed.

No option to config write_graphite to use tcp connection

I thought write_graphite's default connection was tcp. From what I observed, this doesn't seem to be the case. All my minions were sending packets to carbon through udp.

The pillar file and write_graphite.conf file also don't have any protocol option. So I had to manually add the protocol line in the write_graphite.conf file, setting it to tcp.

Am I the only one hitting this issue?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.