Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zabbix Log level #12

Open
xurxofp opened this issue Nov 6, 2019 · 4 comments
Open

Zabbix Log level #12

xurxofp opened this issue Nov 6, 2019 · 4 comments

Comments

@xurxofp
Copy link

xurxofp commented Nov 6, 2019

I'm seeing log messages behind my log level in Zabbix logs.

For example I see a lot of messages about unmarshalling (LOG_LEVEL_DEBUG) when I'am in warning level.

Is this a bug or there is something that I have to configure for this to work?

See for example this message, is printed in debug level but I'm seeing it when in warning.

@jangaraj
Copy link
Collaborator

jangaraj commented Nov 6, 2019

See zabbix-tools/zabbix-module-systemd#37 -> probably you will need config.h generated by Zabbix.

@xurxofp
Copy link
Author

xurxofp commented Nov 6, 2019

Hi @jangaraj thank you for your answer,

Yes, that it’s definitely the problem, but I’m not having luck with the solution, my environment it’s a little bit strange:

I’m compiling Zabbix from a Dockerfile and immediately after that, compilling libzbxpython. Doing that I get the following error:

make[2]: Entering directory '/tmp/libzbxpython/src'
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..     -I/tmp/zabbix-4.0.12/include -I/usr/include/python3.7m -g -O2 -MT python_la-libzbxpython.lo -MD -MP -MF .deps/python_la-libzbxpython.Tpo -c -o python_la-libzbxpython.lo `test -f 'libzbxpython.c' || echo './'`libzbxpython.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I/tmp/zabbix-4.0.12/include -I/usr/include/python3.7m -g -O2 -MT python_la-libzbxpython.lo -MD -MP -MF .deps/python_la-libzbxpython.Tpo -c libzbxpython.c  -fPIC -DPIC -o .libs/python_la-libzbxpython.o
libzbxpython.c: In function 'zbx_module_init':
libzbxpython.c:135:36: error: 'ZABBIX_PYTHON_MODULE_PATH' undeclared (first use in this function); did you mean 'ZABBIX_MODULE_H'?
     pyValue = PyUnicode_FromString(ZABBIX_PYTHON_MODULE_PATH);
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~
                                    ZABBIX_MODULE_H
libzbxpython.c:135:36: note: each undeclared identifier is reported only once for each function it appears in

That I “solve” removing the used sources and downloading another ones to compile libzbxpython. But then I have the problem that I don’t have the config.h ready for the logs.

I hope that I was able to explain it to you correctly.
Again, thank you very much for your time

@jangaraj
Copy link
Collaborator

jangaraj commented Nov 6, 2019

#<folder with zabbix source code>$ ./bootstrap.sh; ./configure

And you will have Zabbix config.h ready.

@xurxofp
Copy link
Author

xurxofp commented Nov 6, 2019

If I do that I get the aftermentioned error.

The only way to not have the error is with a clean sources.

Here I have a snippet of the dockerfile with the problem:

RUN cd /tmp/ && \
    git clone ${ZBX_SOURCES} --branch ${ZBX_VERSION} --depth 1 --single-branch zabbix-${ZBX_VERSION} && \
    cd /tmp/zabbix-${ZBX_VERSION} && \
    ./bootstrap.sh && \
    ./configure && \
    cd /tmp/ && \
    git clone https://github.com/dav3860/libzbxpython.git && \
    cd /tmp/libzbxpython && \
    ./autogen.sh && \
    PYTHON_VERSION=3 ./configure \
            --libdir=/var/lib/zabbix/modules \
            --with-zabbix=/tmp/zabbix-${ZBX_VERSION} \
            --with-zabbix-conf=/etc/zabbix \
            --with-python-modules=/var/lib/zabbix/modules/python && \
    make && \
    make install

If I do exactly the same without "./bootstrap.sh and ./configure" everything works as expected (Without the logs of course)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants