sysdig icon indicating copy to clipboard operation
sysdig copied to clipboard

[Sysdig OpenSource] Inconsistent behaviour when capturing container events

Open Brandonage opened this issue 8 years ago • 1 comments

I think there is an issue when writing events to a file for a container that has been launched after sysdig started the dumping process. I'll try to explain the process I'm following step by step:

  1. I launch a set of containers. For this example lets imagine I launch a bunch of wordpress docker instances.

  2. I start sysdig through a Docker container. The objective is to capture all the ipv4 and ipv6 activity excluding any stress-ng process:

sudo docker run -i -t --name sysdig --privileged -v /var/run/docker.sock:/host/var/run/docker.sock -v /dev:/host/dev -v /proc:/host/proc:ro -v /boot:/host/boot:ro -v /lib/modules:/host/lib/modules:ro -v /usr:/host/usr:ro -v /home/vagrant:/host/vagrant sysdig/sysdig sysdig "not(proc.name contains stress-ng)" and "(fd.type=ipv4 or fd.type=ipv6)" and evt.is_io=true -w example.scrap

  1. If I print out the events for the mentioned wordpress instances I can see them no problem. I can see these events while the dumping process is still on-going or after stopping sysdig.

sudo docker run -i -t --rm --name sysdig2 --privileged -v /var/run/docker.sock:/host/var/run/docker.sock -v /dev:/host/dev -v /proc:/host/proc:ro -v /boot:/host/boot:ro -v /lib/modules:/host/lib/modules:ro -v /usr:/host/usr:ro -v /home/vagrant:/host/vagrant sysdig/sysdig sysdig -pc"%evt.rawtime.s,%fd.num,%fd.type,%evt.type,%evt.dir,%proc.name,%proc.pid,%container.name,%container.image,%container.id,%container.type,%fd.name,%fd.cip,%fd.sip,%fd.lip,%fd.rip,%fd.is_server,%fd.cport,%fd.sport,%fd.lport,%fd.rport,%fd.l4proto,%evt.io_dir,%evt.category,%evt.rawarg.res" -r example.scrap

c17:31:11,recvfrom,res=119 data=............#marathonlb-loadbalancer-wordpresslb.marathon-user.containerip.dcos. tuple=127.0.0.11:53->127.0.0.1:34847 ,<,apache2,10866,mesos-2e2dcae8-708d-4da1-936b-ad799a2db231,wordpress,2a2d17efb21d,docker,127.0.0.1,127.0.0.11,34847,53,34847, 53, udp, read, false, net,119,

  1. While the dumping process started in 2 is still on-going I launch another set of docker instances. In this case I launch a set of Kafka Brokers (ches/kafka).

  2. I stop the dumping process and I try to find the events that correspond to the kafka containers from the example.scrap file. I use the same command as 3, but the events are not there. This is a strange behaviour, because I checked that sysdig is able to capture these events by launching it after starting the kafka containers. They showed up correctly in the console.

17:53:50,read,res=83 data=......K...kafka-python-1.3.4............. ........kafkascenario..............C.. ,<,java,20371,mesos-24d33b1d-bcf6-4cf0-91d8-af378cb21f4f,ches/kafka,0bcbcf59214e,docker,9.0.3.137,9.0.5.136,43924,9092,9092, 43924, tcp, read, false, net,83,

Are there any known issues with sysdig capturing events into a file if the containers are started after sysdig started running?.

Brandonage avatar Dec 12 '17 11:12 Brandonage

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Feb 23 '23 02:02 github-actions[bot]