monitoringartist / zabbix-docker-monitoring

:whale: Docker/Kubernetes/Mesos/Marathon/Chronos/LXC/LXD/Swarm container monitoring - Docker image, Zabbix template and C module
https://hub.docker.com/r/monitoringartist/zabbix-agent-xxl-limited/
GNU General Public License v2.0
1.19k stars 268 forks source link

Can't compile module for zabbix 4.0.15-4.0.17 #136

Closed djonik1562 closed 4 years ago

djonik1562 commented 4 years ago

Hello. For zabbix 4.0.14 module was be compiled. For zabbix 4.0.15-4.0.17 errors during compile:

gcc -fPIC -shared -o zabbix_module_docker.so zabbix_module_docker.c -I../../../include -I../../../src/libs/zbxsysinfo
zabbix_module_docker.c: In function 'zbx_module_docker_inspect_exec':
zabbix_module_docker.c:385:28: error: too few arguments to function 'zbx_json_value_by_name'
             if (SUCCEED != zbx_json_value_by_name(&jp_data, param1, api_value, buffer_size))
                            ^~~~~~~~~~~~~~~~~~~~~~
In file included from zabbix_module_docker.c:25:0:
../../../include/zbxjson.h:196:6: note: declared here
 int  zbx_json_value_by_name(const struct zbx_json_parse *jp, const char *name, char *string, size_t len,
      ^~~~~~~~~~~~~~~~~~~~~~
zabbix_module_docker.c:402:40: error: too few arguments to function 'zbx_json_value_by_name'
                         if (SUCCEED != zbx_json_value_by_name(&jp_data2, param2, api_value2, buffer_size))
                                        ^~~~~~~~~~~~~~~~~~~~~~
In file included from zabbix_module_docker.c:25:0:
../../../include/zbxjson.h:196:6: note: declared here
 int  zbx_json_value_by_name(const struct zbx_json_parse *jp, const char *name, char *string, size_t len,
      ^~~~~~~~~~~~~~~~~~~~~~
zabbix_module_docker.c:486:47: error: too few arguments to function 'zbx_json_value_by_name'
                                if (SUCCEED != zbx_json_value_by_name(&jp_data3, param3, api_value3, buffer_size))
                                               ^~~~~~~~~~~~~~~~~~~~~~
In file included from zabbix_module_docker.c:25:0:
../../../include/zbxjson.h:196:6: note: declared here
 int  zbx_json_value_by_name(const struct zbx_json_parse *jp, const char *name, char *string, size_t len,
      ^~~~~~~~~~~~~~~~~~~~~~
zabbix_module_docker.c: In function 'zbx_module_docker_port_discovery':
zabbix_module_docker.c:611:17: error: too few arguments to function 'zbx_json_value_by_name'
     if (FAIL == zbx_json_value_by_name(&jp_obj, "HostPort", host_port, sizeof(host_port))) {
                 ^~~~~~~~~~~~~~~~~~~~~~
In file included from zabbix_module_docker.c:25:0:
../../../include/zbxjson.h:196:6: note: declared here
 int  zbx_json_value_by_name(const struct zbx_json_parse *jp, const char *name, char *string, size_t len,
      ^~~~~~~~~~~~~~~~~~~~~~
zabbix_module_docker.c: In function 'zbx_module_docker_discovery_extended':
zabbix_module_docker.c:1795:32: error: too few arguments to function 'zbx_json_value_by_name'
                 if (SUCCEED != zbx_json_value_by_name(&jp_row, "Id", cid, cid_length))
                                ^~~~~~~~~~~~~~~~~~~~~~
In file included from zabbix_module_docker.c:25:0:
../../../include/zbxjson.h:196:6: note: declared here
 int  zbx_json_value_by_name(const struct zbx_json_parse *jp, const char *name, char *string, size_t len,
      ^~~~~~~~~~~~~~~~~~~~~~
zabbix_module_docker.c: In function 'zbx_module_docker_info':
zabbix_module_docker.c:1955:24: error: too few arguments to function 'zbx_json_value_by_name'
         if (SUCCEED != zbx_json_value_by_name(&jp_data, info, api_value, buffer_size))
                        ^~~~~~~~~~~~~~~~~~~~~~
In file included from zabbix_module_docker.c:25:0:
../../../include/zbxjson.h:196:6: note: declared here
 int  zbx_json_value_by_name(const struct zbx_json_parse *jp, const char *name, char *string, size_t len,
      ^~~~~~~~~~~~~~~~~~~~~~
zabbix_module_docker.c: In function 'zbx_module_docker_stats':
zabbix_module_docker.c:2032:28: error: too few arguments to function 'zbx_json_value_by_name'
             if (SUCCEED != zbx_json_value_by_name(&jp_data, param1, api_value, buffer_size))
                            ^~~~~~~~~~~~~~~~~~~~~~
In file included from zabbix_module_docker.c:25:0:
../../../include/zbxjson.h:196:6: note: declared here
 int  zbx_json_value_by_name(const struct zbx_json_parse *jp, const char *name, char *string, size_t len,
      ^~~~~~~~~~~~~~~~~~~~~~
zabbix_module_docker.c:2047:40: error: too few arguments to function 'zbx_json_value_by_name'
                         if (SUCCEED != zbx_json_value_by_name(&jp_data2, param2, api_value2, buffer_size))
                                        ^~~~~~~~~~~~~~~~~~~~~~
In file included from zabbix_module_docker.c:25:0:
../../../include/zbxjson.h:196:6: note: declared here
 int  zbx_json_value_by_name(const struct zbx_json_parse *jp, const char *name, char *string, size_t len,
      ^~~~~~~~~~~~~~~~~~~~~~
zabbix_module_docker.c:2062:52: error: too few arguments to function 'zbx_json_value_by_name'
                                     if (SUCCEED != zbx_json_value_by_name(&jp_data3, param3, api_value3, buffer_size))
                                                    ^~~~~~~~~~~~~~~~~~~~~~
In file included from zabbix_module_docker.c:25:0:
../../../include/zbxjson.h:196:6: note: declared here
 int  zbx_json_value_by_name(const struct zbx_json_parse *jp, const char *name, char *string, size_t len,
      ^~~~~~~~~~~~~~~~~~~~~~
zabbix_module_docker.c: In function 'zbx_module_docker_cstatus':
zabbix_module_docker.c:2244:40: error: too few arguments to function 'zbx_json_value_by_name'
                         if (SUCCEED != zbx_json_value_by_name(&jp_row, "Status", status, cid_length))
                                        ^~~~~~~~~~~~~~~~~~~~~~
In file included from zabbix_module_docker.c:25:0:
../../../include/zbxjson.h:196:6: note: declared here
 int  zbx_json_value_by_name(const struct zbx_json_parse *jp, const char *name, char *string, size_t len,
      ^~~~~~~~~~~~~~~~~~~~~~
zabbix_module_docker.c:2326:48: error: too few arguments to function 'zbx_json_value_by_name'
                                 if (SUCCEED != zbx_json_value_by_name(&jp_row, "Status", status, cid_length))
                                                ^~~~~~~~~~~~~~~~~~~~~~
In file included from zabbix_module_docker.c:25:0:
../../../include/zbxjson.h:196:6: note: declared here
 int  zbx_json_value_by_name(const struct zbx_json_parse *jp, const char *name, char *string, size_t len,
      ^~~~~~~~~~~~~~~~~~~~~~
Makefile:2: recipe for target 'zabbix_module_docker' failed
make: *** [zabbix_module_docker] Error 1

Compile with docker.

jangaraj commented 4 years ago

See https://github.com/monitoringartist/zabbix-docker-monitoring/issues/133

Imho that change was backported to another branches now.

djonik1562 commented 4 years ago

Are you planning fix this in master branch of module? Now 4.0.12 module worked with zabbix 4.0.17. That's enough for me.

jangaraj commented 4 years ago

Sure. But it needs proper fix, which will be working with any Zabbix version. Feel free to create pull request. I'm happy to review any PR.

thebcont commented 4 years ago

Are you planning fix this in master branch of module? Now 4.0.12 module worked with zabbix 4.0.17. That's enough for me.

As it seems, the patch is not working for me either, Still get error messages when running make

How did you suceed in getting the module run on 4.0.17? I Have currently a Test system running on Zabbix 4.0.19 (server and agent) and experiencing the problems you described as well.

zabbix_docker_monitoring_make_error.txt