Giter VIP home page Giter VIP logo

collectd-lxc's People

Contributors

aarnaud avatar multani avatar sebastien-guilbaud-wiztivi avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

collectd-lxc's Issues

no longer works on lxd 2.0.2

the script crashes with the following error, after outputting lots of good statistics :

{'values': [436], 'plugin_instance': '0__prod-main-pg2', 'type_instance': 'ops_read', 'type': 'gauge', 'plugin': 'lxc_blkio'}
{'values': [0], 'plugin_instance': '0__prod-main-pg2', 'type_instance': 'ops_write', 'type': 'gauge', 'plugin': 'lxc_blkio'}
Traceback (most recent call last):
  File "./collectd_lxc.py", line 167, in <module>
    reader()
  File "./collectd_lxc.py", line 118, in reader
    with Namespace(container_PID, 'net'):
  File "/usr/local/lib/python2.7/dist-packages/nsenter/__init__.py", line 69, in __init__
    self.target_fd = Path(pid).open()
  File "/usr/local/lib/python2.7/dist-packages/pathlib.py", line 1077, in open
    return io.open(str(self), mode, buffering, encoding, errors, newline)
IOError: [Errno 21] Is a directory: '.'

I've tracked the origin of the bug here, it tries to find the container's pid, which no longer resides in tasks but in init.scope/tasks (IHMO)

The plugin seems to work with the following crude hack :

--- collectd_lxc.py 2016-09-07 16:51:49.040269863 +0200
+++ /etc/collectd/plugins/collectd_lxc.py   2016-09-07 16:48:13.570307507 +0200
@@ -112,7 +112,7 @@

                 ### Network
                     #PID lxc: cat /sys/fs/cgroup/devices/lxc/CONTAINER-NAME/tasks | head -n 1
-                    with open(os.path.join(metrics[user_id][container_name][metric], 'tasks'), 'r') as f:
+                    with open(os.path.join(metrics[user_id][container_name][metric], 'init.scope/tasks'), 'r') as f:
                         # The first line is PID of container
                         container_PID = f.readline().rstrip()
                         with Namespace(container_PID, 'net'):

Can't install plugin

Hello.

Trying to install your plugin. Have an error:

python plugin: Error importing module "collectd_lxc".
Unhandled python exception in importing module: ImportError: No module named collectd_lxc
python plugin: Found a configuration for the "collectd_lxc" plugin, but the plugin isn't loaded or didn't register a configuration callback.

Ubuntu 18.04.1, collectd 5.7.2.git
Any suggestions please?

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.