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

Document how to run plugins with Zabbix agent 2 Docker image #3

Open
i-ky opened this issue Nov 22, 2022 · 1 comment
Open

Document how to run plugins with Zabbix agent 2 Docker image #3

i-ky opened this issue Nov 22, 2022 · 1 comment

Comments

@i-ky
Copy link
Contributor

i-ky commented Nov 22, 2022

I was experimenting a bit and figured out that after

cd agent2/plugins/myip/ && make

it is possible to "plug" the plugin (pun intended) into official Zabbix agent 2 Docker image like so:

docker run --rm --volume $PWD/myip.conf:/etc/zabbix/zabbix_agent2.d/plugins.d/myip.conf:ro --volume $PWD/myip:/usr/local/zabbix/go/plugins/myip:ro zabbix/zabbix-agent2:ubuntu-trunk -t myip

I guess it may be useful to someone, so it is probably worth documenting this trick.

Important note is that Go plugins are linked against standard C library, therefore it is important to use appropriate tag of Zabbix agent 2 image. For example, if you compile plugin on Ubuntu which uses libc, it will fail to run inside Alpine-based image, since the latter uses musl.

My assumption is that one can also plug multiple plugins into container, each with a pair of --volume options. docker run command may get ugly pretty quickly, so maybe an example Docker Compose file would be nice too.

@dimir
Copy link
Owner

dimir commented Nov 22, 2022

Great idea, I like it!

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