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

Where are the patches applied? #6

Open
gcavalcante8808 opened this issue Nov 8, 2016 · 13 comments
Open

Where are the patches applied? #6

gcavalcante8808 opened this issue Nov 8, 2016 · 13 comments

Comments

@gcavalcante8808
Copy link

Hello Friend,

I cannot find the patches applied on agent to allow it to read system data from /data/proc and so on ... Can you provide the patches or the version system where they lie?

@Atem18
Copy link

Atem18 commented Dec 1, 2016

+1 Would be great to know how it is done.

@gcavalcante8808
Copy link
Author

gcavalcante8808 commented Dec 1, 2016 via email

@Atem18
Copy link

Atem18 commented Dec 13, 2016

@gcavalcante8808 I did the same, and indeed, it does not work.

@gcavalcante8808
Copy link
Author

@Atem18 Hello Friend ... so much time have passed ... but the solution appeared!

Check at https://github.com/gcavalcante8808/docker-zabbix-agent.git

There is no need to patch the agentd or install packages into the host system; we can use just the docker to provide a way to monitor the host system :D

@Atem18
Copy link

Atem18 commented Feb 9, 2017

@gcavalcante8808 That's nice, I actually did something similar to you, by using the official Zabbix Docker image and implementing my scripts to execute commands via chroot command.

@Atem18
Copy link

Atem18 commented Feb 13, 2017

@gcavalcante8808 I have a question, I tried your Docker but it can only see container's processes (ex: in Docker Zabbix server, Zabbix agent find 52 processes but my host has more than 450 processes). How did you do to monitor your host's processes and get back the info into Zabbix Server?

Thanks in advance.

@gcavalcante8808
Copy link
Author

@Atem18 Just the zabbix-agent is aware of host proccesses because its is started inside a proot that use /rootfs as the root (which is your host root volume mounted) then the agent can see and verify the proccesses. Try to use the zabbix_get to get the proccess, like the following:

zabbix_get -s 127.0.0.1 -k proc.num[""]

The following example works at a computer that uses network manager applet:

docker exec -it zabbix_agentd bash
zabbix_get -s 127.0.0.1 -k proc.num["nm-applet"]

@Atem18
Copy link

Atem18 commented Feb 14, 2017

@gcavalcante8808 Now I understand, I tried as you said and indeed it works, so I will probably use that method. I just need to be sure that I can access hosts's binaries from Zabbix container.
So thanks a lot mate :)

@gcavalcante8808
Copy link
Author

@Atem18 take a look inside the docker-entrypoint.sh, the proot command mount the libs and binaries from the container to the host!, something like the following (last line of the script):

exec proot -r /rootfs -b /usr/local/sbin -m /usr/local/sbin
-b /usr/local/bin -m /usr/local/bin
-b /usr/lib -m /usr/lib -b /usr/local/etc -m /usr/local/etc
sh -c "LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu /usr/local/sbin/zabbix_agentd -c /usr/local/etc/zabbix_agentd.conf --foreground"

@Atem18
Copy link

Atem18 commented Feb 14, 2017

@gcavalcante8808 Yeah I saw, I tried to add -b /usr/bin -m /usr/bin but from inside the container I have no access to my hosts's binaries like /usr/bin/docker, I have an output like :
zabbix@94b276c1b4a6:/$ /usr/bin/docker bash: /usr/bin/docker: No such file or directory

@gcavalcante8808
Copy link
Author

@Atem18 In your case, you're mounting the /usr/bin from the container to the host ... is it intendend? Or are you trying to use the docker client from the host?

Take a look at the link below for more information:

https://wiki.archlinux.org/index.php/Proot

@Atem18
Copy link

Atem18 commented Feb 14, 2017

@gcavalcante8808 No it's probably a mistake, I want to execute docker or any binary I have on my host inside my container, for my customs scripts.
Thanks for the link, I will check the documentation to get it done.

@gcavalcante8808
Copy link
Author

@Atem18 you can use your host's binaries, but not when you mount the container "/usr/bin" folder over them :D A more appropriate read of the doc should help you to understand the things in the right way. Feel free to contact me if you need some help. Cya

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