Code Monkey home page Code Monkey logo

zabbix-lxd's Introduction

zabbix-lxd

A loadable module for Zabbix Agent in order to monitor LXD containers.

Get the source

When you have Zabbix installed from the official repository:

# debian / ubuntu / proxmox
apt install dpkg-dev
apt-get source zabbix-agent
cd zabbix-3.2.x

# redhat / centos
# TODO

or directly from svn:

mkdir zabbix3.2
cd zabbix3.2
svn co svn://svn.zabbix.com/branches/3.2 .
./bootstrap.sh

Compiling the module

./configure --enable-agent
mkdir src/modules/zabbix_module_lxd
cd src/modules/zabbix_module_lxd
wget https://raw.githubusercontent.com/scanterog/zabbix-lxd/master/zabbix_module_lxd.c \
  https://raw.githubusercontent.com/scanterog/zabbix-lxd/master/Makefile
make

The output should be a dynamically linked shared object library named zabbix_module_lxd.so.

Install and configure the module

To install the module:

mkdir -p /usr/lib/zabbix/modules
cp zabbix_module_lxd.so /usr/lib/zabbix/modules

To enable the module, add in /etc/zabbix/zabbix_agentd.conf:

LoadModule=zabbix_module_lxd.so

Finally, restart the zabbix-agent and upload Zabbix-template-LXD.xml to your Zabbix server.

zabbix-lxd's People

Contributors

omniton avatar pimlie avatar scanterog avatar scgnu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

zabbix-lxd's Issues

Possible Mismatch in CPU user time reports

Hi,
Many thanks for this tool.
Total number of CPU cores on my system is 16, so I expect a max cpu user time of 1600% but I am getting higher values than this.
I am using zabbix 3.2
Kindly help.

unable to load module Ubuntu 16.04.1

Ubuntu 16.04.1 LTS

Kernel 4.4.0-53-generic #74-Ubuntu SMP Fri Dec 2 15:59:10 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

 27982:20161208:071632.751 using configuration file: /etc/zabbix/zabbix_agentd.conf
 27982:20161208:071632.752 cannot load module "zabbix_module_lxd.so": /usr/lib/x86_64-linux-gnu/modules/zabbix_module_lxd.so: undefined symbol: zbx_alarm_timed_out
 27982:20161208:071632.752 loading modules failed, exiting...

Agent version:
ii zabbix-agent 1:2.4.7+dfsg-2ubuntu2.1 amd64 network monitoring solution - agent

Just to note, I have seen the following after running "make", yet, the module was created.

:~/zabbix3.2/src/modules/zabbix_module_lxd# make
gcc -fPIC -shared -o zabbix_module_lxd.so zabbix_module_lxd.c -I../../../include -I../../../src/libs/zbxsysinfo
zabbix_module_lxd.c: In function ‘zbx_module_lxd_dev’:
zabbix_module_lxd.c:515:9: warning: null argument where non-null required (argument 1) [-Wnonnull]
         char    *stat_file = malloc(strlen(get_rparam(request, 1)) + 2);
         ^
zabbix_module_lxd.c:516:9: warning: null argument where non-null required (argument 1) [-Wnonnull]
         zbx_strlcpy(stat_file, "/", strlen(get_rparam(request, 1)) + 2);
         ^
zabbix_module_lxd.c:517:9: warning: null argument where non-null required (argument 1) [-Wnonnull]
         zbx_strlcat(stat_file, get_rparam(request, 1), strlen(get_rparam(request, 1)) + 2);
         ^

syntax error iksemel

On Debian jessie (8.6) performs the commands "./configure --enable-agent" to:

... checking for architecture... linux (linux-gnu) checking for the linux kernel version... unknown family (3.16.0-4-amd64) checking size of void *... 8 ./configure: line 8989: syntax error near unexpected tokenIKSEMEL,iksemel,'
./configure: line 8989: PKG_CHECK_MODULES(IKSEMEL,iksemel,'

Update for new lxd :)

Hi, I'm running LXD 4.7 on Ubuntu 20.04
Since directories hierarchy of LXD stats has been changed from /sys/fs/cgroup/cpuset/lxc to something like
/sys/fs/cgroup/cpuset/lxc.monitor.containername
/sys/fs/cgroup/cpuset/lxc.payload.containername
we are have some errors :)

3948212:20201105:235120.434 In zbx_load_modules()
3948212:20201105:235120.434 loading module "/usr/lib/zabbix/modules/zabbix_module_lxd.so"
3948212:20201105:235120.434 In zbx_module_api_version()
3948212:20201105:235120.434 In zbx_module_init()
3948212:20201105:235120.434 zabbix_module_lxd v0.1, compilation time: Nov 5 2020 23:50:50
3948212:20201105:235120.434 In zbx_lxd_dir_detect()
3948212:20201105:235120.435 Detected LXD stat directory: /sys/fs/cgroup/
3948212:20201105:235120.435 ddir to test: /sys/fs/cgroup/cpuset/lxc/
3948212:20201105:235120.435 Cannot detect used LXD driver

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.