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

Error running the module #23

Closed
dedenker opened this issue Sep 6, 2015 · 10 comments
Closed

Error running the module #23

dedenker opened this issue Sep 6, 2015 · 10 comments

Comments

@dedenker
Copy link

dedenker commented Sep 6, 2015

I compiled the module as it says in the README.
On "OpenMediaVault" debian version 7.8
But when the zabbix agent starts I get an error, here is a debug level 4 log:
using configuration file: /usr/local/etc/zabbix_agentd.conf
19975:20150906:230914.178 In load_modules()
19975:20150906:230914.179 loading module "/usr/local/lib/modules/zabbix_module_docker.so"
19975:20150906:230914.179 cannot load module "zabbix_module_docker.so": /usr/local/lib/modules/zabbix_module_docker.so: undefined symbol: add_request_param
19975:20150906:230914.179 End of load_modules():FAIL
19975:20150906:230914.179 loading modules failed, exiting...

@jangaraj
Copy link
Member

jangaraj commented Sep 7, 2015

Which version of Zabbix agent did you use? How did compile your Zabbix agent?

@dedenker
Copy link
Author

dedenker commented Sep 7, 2015

version 2.4 as your manual, just followed those steps.
Is there anyway to get more information of what the module is (not) doing?
The zabbix agent without the module works fine.

@jangaraj
Copy link
Member

jangaraj commented Sep 7, 2015

Makefile is including add_request_param function from Zabbix agent source code:

-I../../../src/libs/zbxsysinfo

add_request_param is available during compilation, because you don't have compilation error. But then you are executing some binary zabbix_agent(d) code and I'm curious about this binary code (this binary code has some issue). It can be package from (un)official repo, it can be different version (e.g. 1.8), it can be compiled locally, ....

So I need information about your Zabbix agent, not zabbix module. How did you install your Zabbix agent on your system and which version?

@dedenker
Copy link
Author

dedenker commented Sep 7, 2015

At the moment I can not investigate the problem because of network issues.
They promise to have it fixed within 8 hours! Anyway, I will give you the information tomorrow by the latest...so you know.

@dedenker
Copy link
Author

dedenker commented Sep 7, 2015

Okay, got the info:
zabbix_agent --version = Zabbix agent v2.4.0 (revision 48953)
zabbix_agentd --version = Zabbix Agent (daemon) v2.4.0 (revision 48953)

I compiled the zabbix agent as it stated in the manual (official wiki)
configure --enable-agent
make
make install

Is this any use?

@jangaraj
Copy link
Member

jangaraj commented Sep 7, 2015

No clue. Could you provide full commands/logs/outputs how did you checkout/compile module please? Please attach also your zabbix agent config, enable debugging and start agent - attach full startup logs +

cat /etc/debian_version
uname -a
whereis zabbix_agentd
ldd $(whereis zabbix_agentd)
ldd zabbix_module_docker.so

@dedenker
Copy link
Author

dedenker commented Sep 8, 2015

Here are the answers:

  • debian_version = 7.8

  • uname = Linux archive 3.2.0-4-amd64 How can I use Zabbix-Docker-Monitoring on CentOS 6.5? #1 SMP Debian 3.2.68-1+deb7u2 x86_64 GNU/Linux

  • whereis = zabbix_agentd: /usr/local/sbin/zabbix_agentd /usr/local/etc/zabbix_agentd.conf

  • ldd $(whereis zabbix_agentd) =
    zabbix_agentd::
    ldd: ./zabbix_agentd:: No such file or directory
    /usr/local/sbin/zabbix_agentd:
    linux-vdso.so.1 => (0x00007fff2e8e3000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f7b910ea000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f7b90ee6000)
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f7b90cdd000)
    libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f7b90ac7000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7b9073c000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f7b91375000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f7b9051f000)
    /usr/local/etc/zabbix_agentd.conf:
    not a dynamic executable

  • ldd: ./zabbix_module_docker.so: No such file or directory
    Which is strang, I placed in the default in module directory, so is picked up by the agent deamon.
    Here is the Agent config:

    PidFile=/var/log/zabbix/zabbix_agentd.pid
    LogFile=/var/log/zabbix/zabbix_agentd.log
    DebugLevel=4
    EnableRemoteCommands=1
    Server=192.168.50.120
    ServerActive=192.168.50.120
    Hostname=OpenMediaVault
    UserParameter=xdocker.cpu[*],grep $2 /cgroup/cpuacct/docker/$1/cpuacct.stat | awk '{print $$2}'
    LoadModule=zabbix_module_docker.so

Then the start up log if I look at the log file with with debug level 4:
Here are the answers:

  • debian_version = 7.8

  • uname = Linux archive 3.2.0-4-amd64 How can I use Zabbix-Docker-Monitoring on CentOS 6.5? #1 SMP Debian 3.2.68-1+deb7u2 x86_64 GNU/Linux

  • whereis = zabbix_agentd: /usr/local/sbin/zabbix_agentd /usr/local/etc/zabbix_agentd.conf

  • ldd $(whereis zabbix_agentd) =
    zabbix_agentd::
    ldd: ./zabbix_agentd:: No such file or directory
    /usr/local/sbin/zabbix_agentd:
    linux-vdso.so.1 => (0x00007fff2e8e3000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f7b910ea000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f7b90ee6000)
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f7b90cdd000)
    libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f7b90ac7000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7b9073c000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f7b91375000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f7b9051f000)
    /usr/local/etc/zabbix_agentd.conf:
    not a dynamic executable

  • ldd: ./zabbix_module_docker.so: No such file or directory
    Which is strang, I placed in the default in module directory, so is picked up by the agent deamon.
    Here is the Agent config:

    PidFile=/var/log/zabbix/zabbix_agentd.pid
    LogFile=/var/log/zabbix/zabbix_agentd.log
    DebugLevel=4
    EnableRemoteCommands=1
    Server=192.168.50.120
    ServerActive=192.168.50.120
    Hostname=OpenMediaVault
    UserParameter=xdocker.cpu[*],grep $2 /cgroup/cpuacct/docker/$1/cpuacct.stat | awk '{print $$2}'
    LoadModule=zabbix_module_docker.so

Then the start up log if I look at the log file with with debug level 4:
Here are the answers:

  • debian_version = 7.8

  • uname = Linux archive 3.2.0-4-amd64 How can I use Zabbix-Docker-Monitoring on CentOS 6.5? #1 SMP Debian 3.2.68-1+deb7u2 x86_64 GNU/Linux

  • whereis = zabbix_agentd: /usr/local/sbin/zabbix_agentd /usr/local/etc/zabbix_agentd.conf

  • ldd $(whereis zabbix_agentd) =
    zabbix_agentd::
    ldd: ./zabbix_agentd:: No such file or directory
    /usr/local/sbin/zabbix_agentd:
    linux-vdso.so.1 => (0x00007fff2e8e3000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f7b910ea000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f7b90ee6000)
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f7b90cdd000)
    libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f7b90ac7000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7b9073c000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f7b91375000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f7b9051f000)
    /usr/local/etc/zabbix_agentd.conf:
    not a dynamic executable

  • ldd: ./zabbix_module_docker.so: No such file or directory
    Which is strang, I placed in the default in module directory, so is picked up by the agent deamon.
    Here is the Agent config:

    PidFile=/var/log/zabbix/zabbix_agentd.pid
    LogFile=/var/log/zabbix/zabbix_agentd.log
    DebugLevel=4
    EnableRemoteCommands=1
    Server=192.168.50.120
    ServerActive=192.168.50.120
    Hostname=OpenMediaVault
    UserParameter=xdocker.cpu[*],grep $2 /cgroup/cpuacct/docker/$1/cpuacct.stat | awk '{print $$2}'
    LoadModule=zabbix_module_docker.so

Then the start up log if I look at the log file with with debug level 4:
19975:20150906:230914.178 Starting Zabbix Agent [OpenMediaVault]. Zabbix 2.4.0 (revision 48953).
19975:20150906:230914.178 using configuration file: /usr/local/etc/zabbix_agentd.conf
19975:20150906:230914.178 In load_modules()
19975:20150906:230914.179 loading module "/usr/local/lib/modules/zabbix_module_docker.so"
19975:20150906:230914.179 cannot load module "zabbix_module_docker.so": /usr/local/lib/modules/zabbix_module_docker.so: undefined symbol: add_request_param
19975:20150906:230914.179 End of load_modules():FAIL
19975:20150906:230914.179 loading modules failed, exiting...

@jangaraj
Copy link
Member

jangaraj commented Sep 8, 2015

If you can, pls delete all Zabbix stuff (I see a few zabbix_agentds in different locations) on your server and execute these commands - it will compile module/agent with test config. It's user error from my point of view, but still I don't know how and what did you do. So please execute these commands and provide outputs from your console (yes, it can be huge but I need to see everything):

apt-get update
apt-get install -y wget autoconf automake gcc subversion make pkg-config
cd ~
mkdir zabbix24
cd zabbix24
svn co svn://svn.zabbix.com/branches/2.4 .
./bootstrap.sh
./configure --enable-agent
make
make install
mkdir src/modules/zabbix_module_docker
cd src/modules/zabbix_module_docker
wget https://raw.githubusercontent.com/monitoringartist/Zabbix-Docker-Monitoring/master/src/modules/zabbix_module_docker/zabbix_module_docker.c
wget https://raw.githubusercontent.com/monitoringartist/Zabbix-Docker-Monitoring/master/src/modules/zabbix_module_docker/Makefile
make
cp zabbix_module_docker.so /tmp
chmod 777 /tmp/zabbix_module_docker.so
touch /tmp/testzabbixconfig.conf
chmod 777 /tmp/testzabbixconfig.conf
echo "Server=127.0.0.1" >> /tmp/testzabbixconfig.conf
echo "LoadModulePath=/tmp" >> /tmp/testzabbixconfig.conf
echo "DebugLevel=4" >> /tmp/testzabbixconfig.conf
echo "LoadModule=zabbix_module_docker.so" >> /tmp/testzabbixconfig.conf
echo "AllowRoot=1" >> /tmp/testzabbixconfig.conf
echo "LogFile=/tmp/zbx.log" >>  /tmp/testzabbixconfig.conf
/usr/local/sbin/zabbix_agentd -c /tmp/testzabbixconfig.conf
sleep 60
cat /tmp/zbx.log

Please use:

```

for code/logs/ formatting - https://guides.github.com/features/mastering-markdown/

@dedenker
Copy link
Author

dedenker commented Sep 9, 2015

Okay, indeed there was a lot of text.
So I did setup a similar server (OS) and did everything you said.
And the module did work, I could only not really test as the machine doesn't had the production docker environment!
But the problem is with the machine, not your source.
I will investigate if it is the zabbix agent or something else.

@jangaraj
Copy link
Member

jangaraj commented Sep 9, 2015

Cool, I'm closing this issue, because it's not related to module. Please use Zabbix forum for your problem.

@jangaraj jangaraj closed this as completed Sep 9, 2015
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