GithubHelp home page GithubHelp logo

docker-watcher's Introduction

docker-watcher

Keep track of running docker containers and analyze network traffic usage. Logs follow a naming convention container_interface_date and will be rotated or not according to a given parameter.

Usage

$ ./docker-watcher.sh -d|--discovery <discovery_time> -t|--t <time_period> -r|--rotate <yes/no> -n|--network <network> (default: all) -o|--output <output_folder>
  • discovery_period: is the interval time for the script to wait to check if new containers have been started.
  • time_period: is the elapsed time to store new traffic dumps.
  • rotate: whether or not to rotate logs
  • network: the docker network to observe
  • output_folder: the output folder where pcaps will be stored.

Example

$ ./docker-watcher.sh -d 5 -t 3 -r yes -n etmsplatform_default

This will check the running dockers every 5 seconds and create a new pcap file for each container every 3 seconds. The output will be like:

  pcap/
    interface1/
      container1/
        container1_br-31cc34v_2017-01-31_11:07:08.pcap
        container1_br-31cc34v_2017-01-31_11:07:14.pcap
      container2/
        container2_br-31cc34v_2017-01-31_11:07:10.pcap
    network_name_br-31cc34v_2017-01-31_11:07:10.pcap
      ...

As seen, the file structure allows for easy future processing. Each group of containers connected to the same network (same interface accesible by the host) will be created under the same folder named after the interface, and also inside a folder with the container's name. The name of the container .pcap files follows the convention of <network_interface><creation_date>. A capture file is created with all the traffic going through a single network interface, while for each container only it's own inbound/outbound traffic is logged.

docker-watcher's People

Contributors

fr0gs avatar lluiscampos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.