Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sensu-Client inside Docker container

I created a customize Docker image based on ubuntu 14.04 with the Sensu-Client package inside.

Everything's went fine but now I'm wondering how can I trigger the checks to run from the hosts machine.

For example, I want to be able to check the processes that are running on the host machine and not only the ones running inside the container.

Thanks

like image 223
Ilan Avatar asked Oct 31 '22 09:10

Ilan


1 Answers

It depends on what checks you want to run. A lot of system-level checks work fine if you run sensu container with --net=host and --privileged flags. --net=host not just allows you to see the same hostname and IP as host system, but also all the tcp connections and interface metric will match for container and host.

--privileged gives container full access to system metrics like hdd, memory, cpu.

Tricky thing is checking external process metrics, as docker isolates it even from privileged container, but you can share host's root filesystem as docker volume ( -v /:/host) and patch check to use chroot or use /host/proc instead of /proc.

Long story short, some checks will just work, for others you need to patch or develop your own way, but sensu in docker is one possible way.

like image 60
DukeLion Avatar answered Nov 15 '22 06:11

DukeLion