Ad Widget

Collapse

Loading modules

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pl33g0r
    Junior Member
    • Mar 2015
    • 1

    #1

    Loading modules

    Hello!

    I am trying to install zabbix module for docker (https://github.com/jangaraj/Zabbix-Docker-Monitoring). I was able to upload xml template without any issues. However, when I am trying to run Makefile script on zabbix server I am getting the following errors:
    Code:
    ./Makefile
    ./Makefile: line 1: zabbix_module_docker:: command not found
    zabbix_module_docker.c:20: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before string constant
    zabbix_module_docker.c:30: error: expected ‘)’ before ‘*’ token
    zabbix_module_docker.c:31: error: expected ‘)’ before ‘*’ token
    zabbix_module_docker.c:32: error: expected ‘)’ before ‘*’ token
    zabbix_module_docker.c:33: error: expected ‘)’ before ‘*’ token
    zabbix_module_docker.c:34: error: expected ‘)’ before ‘*’ token
    zabbix_module_docker.c:35: error: expected ‘)’ before ‘*’ token
    zabbix_module_docker.c:37: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘keys’
    zabbix_module_docker.c: In function ‘zbx_module_api_version’:
    zabbix_module_docker.c:60: error: ‘LOG_LEVEL_DEBUG’ undeclared (first use in this function)
    zabbix_module_docker.c:60: error: (Each undeclared identifier is reported only once
    zabbix_module_docker.c:60: error: for each function it appears in.)
    zabbix_module_docker.c:61: error: ‘ZBX_MODULE_API_VERSION_ONE’ undeclared (first use in this function)
    zabbix_module_docker.c: In function ‘zbx_module_item_timeout’:
    zabbix_module_docker.c:75: error: ‘LOG_LEVEL_DEBUG’ undeclared (first use in this function)
    zabbix_module_docker.c:76: error: ‘item_timeout’ undeclared (first use in this function)
    zabbix_module_docker.c: At top level:
    zabbix_module_docker.c:88: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
    zabbix_module_docker.c:103: error: expected ‘)’ before ‘*’ token
    zabbix_module_docker.c:157: error: expected ‘)’ before ‘*’ token
    zabbix_module_docker.c:238: error: expected ‘)’ before ‘*’ token
    zabbix_module_docker.c:318: error: expected ‘)’ before ‘*’ token
    zabbix_module_docker.c:343: error: expected ‘)’ before ‘*’ token
    zabbix_module_docker.c:363: error: expected ‘)’ before ‘*’ token
    zabbix_module_docker.c:365:29: error: zbxjson.h: No such file or directory
    zabbix_module_docker.c: In function ‘zbx_module_init’:
    zabbix_module_docker.c:453: error: ‘LOG_LEVEL_DEBUG’ undeclared (first use in this function)
    zabbix_module_docker.c:455: error: ‘ZBX_MODULE_OK’ undeclared (first use in this function)
    zabbix_module_docker.c: In function ‘zbx_docker_stat_detect’:
    zabbix_module_docker.c:471: error: ‘LOG_LEVEL_DEBUG’ undeclared (first use in this function)
    zabbix_module_docker.c:473: error: storage size of ‘s’ isn’t known
    zabbix_module_docker.c:490: error: ‘SYSINFO_RET_FAIL’ undeclared (first use in this function)
    zabbix_module_docker.c:508: error: ‘LOG_LEVEL_ERR’ undeclared (first use in this function)
    zabbix_module_docker.c:512: error: ‘SYSINFO_RET_OK’ undeclared (first use in this function)
    zabbix_module_docker.c: In function ‘zbx_module_uninit’:
    zabbix_module_docker.c:528: error: ‘LOG_LEVEL_DEBUG’ undeclared (first use in this function)
    zabbix_module_docker.c:529: error: ‘ZBX_MODULE_OK’ undeclared (first use in this function)
    This is what happens when I ran Makefile script on the client
    Code:
    /usr/local/lib/zabbix/agent# ./Makefile
    ./Makefile: line 1: zabbix_module_docker:: command not found
    zabbix_module_docker.c:20:20: fatal error: sysinc.h: No such file or directory
     #include "sysinc.h"
                        ^
    compilation terminated.
    I was reading documentation on modules and I have couple of questions:

    1. It is mentioning that there is a dummy.so file, but I was not able to find it neither on server or client
    2. At the same time I would like to know what it the full path for /src/modules
    3. Is there a more easy to understand document that will explain how to add 3rd party modules?

    Thanks in advance!
  • jan.garaj
    Senior Member
    Zabbix Certified Specialist
    • Jan 2010
    • 506

    #2
    If you want to build module, then you need also Zabbix source code. Quick overview how to compile it:
    Code:
    cd ~
    mkdir zabbix24
    cd zabbix24
    svn co svn://svn.zabbix.com/branches/2.4 .
    ./bootstrap.sh
    ./configure --enable-agent
    mkdir src/modules/zabbix_module_docker
    cd src/modules/zabbix_module_docker
    wget https://raw.githubusercontent.com/jangaraj/Zabbix-Docker-Monitoring/master/src/modules/zabbix_module_docker/zabbix_module_docker.c
    wget https://raw.githubusercontent.com/jangaraj/Zabbix-Docker-Monitoring/master/src/modules/zabbix_module_docker/Makefile
    make
    Final output will be zabbix_module_docker.so, which can be loaded by zabbix agent.

    Check the latest doc (5.2.4 Building modules) for more details:


    Thx for feedback, I'll add info how to compile module to README.
    BTW: compiled module is also available https://drone.io/github.com/jangaraj...dule_docker.so
    Devops Monitoring Expert advice: Dockerize/automate/monitor all the things.
    My DevOps stack: Docker / Kubernetes / Mesos / ECS / Terraform / Elasticsearch / Zabbix / Grafana / Puppet / Ansible / Vagrant

    Comment

    Working...