diff --git a/tutorial/docker-basis/cleaning.md b/tutorial/docker-basis/cleaning.md
index 7b65555..09ec72c 100644
--- a/tutorial/docker-basis/cleaning.md
+++ b/tutorial/docker-basis/cleaning.md
@@ -21,10 +21,10 @@ cours d'exécution, arrêtés, ...) avec la commande suivante :
```
-42sh$ docker container ls -a
-CONTAINER ID IMAGE COMMAND CREATED STATUS NAMES
-552d71619723 hello-world "/hello" 4 days ago Exited (0) 4 days ago dreamy_gates
-0e8bbff6d500 debian "/bin/bash" 2 weeks ago Exited (0) 2 weeks ago cranky_jones
+ 42sh$ docker container ls -a
+ CONTAINER ID IMAGE COMMAND CREATED STATUS NAMES
+ 552d71619723 hello-world "/hello" 4 days ago Exited (0) 4 days ago dreamy_gates
+ 0e8bbff6d500 debian "/bin/bash" 2 weeks ago Exited (0) 2 weeks ago cranky_jones
```
@@ -33,7 +33,7 @@ conteneurs. Pour les supprimer, utilisez la commande :
diff --git a/tutorial/docker-basis/ex-flask.md b/tutorial/docker-basis/ex-flask.md
index bbd6ec2..3a32ca5 100644
--- a/tutorial/docker-basis/ex-flask.md
+++ b/tutorial/docker-basis/ex-flask.md
@@ -13,7 +13,7 @@ Nous pouvons télécharger et lancer le service grâce à :
```
-docker container run -i nemunaire/youp0m
+ docker container run -i nemunaire/youp0m
```
@@ -36,7 +36,7 @@ Nous pouvons rediriger le port avec l'argument `-p dst_host:s
```
-docker container run -i -p 8080:8080 nemunaire/youp0m
+ docker container run -i -p 8080:8080 nemunaire/youp0m
```
@@ -47,7 +47,7 @@ utiliser cette syntaxe pour ajouter une image :
@@ -186,9 +186,9 @@ conteneurs en cours d'exécution :
```
-42sh$ docker container ls
-CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
-4c39fc049cd1 ubuntu "/bin/bash" 6 minutes ago Up 5 minutes suspicious_galileo
+ 42sh$ docker container ls
+ CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
+ 4c39fc049cd1 ubuntu "/bin/bash" 6 minutes ago Up 5 minutes suspicious_galileo
```
diff --git a/tutorial/docker-basis/installation.md b/tutorial/docker-basis/installation.md
index 961a105..53e219c 100644
--- a/tutorial/docker-basis/installation.md
+++ b/tutorial/docker-basis/installation.md
@@ -18,7 +18,7 @@ Avant de continuer, assurez-vous que votre machine a bien démarré sur un noyau
```
-x86_64
+ x86_64
```
@@ -26,7 +26,7 @@ Assurez-vous également d'avoir un noyau récent, avec la commande `uname -r` :
```
-4.18.11-gentoo
+ 4.18.11-gentoo
```
@@ -83,7 +83,7 @@ Vous devriez maintenant être capable de lancer la commande suivante :
```
-docker version
+ docker version
```
@@ -91,24 +91,24 @@ Une sortie similaire au bloc suivant devrait apparaître sur votre écran :
```
-Client:
- Version: 18.06.1-ce
- API version: 1.38
- Go version: go1.10.3
- Git commit: e68fc7a
- Built: Sun Sep 9 10:14:56 2018
- OS/Arch: linux/amd64
- Experimental: false
+ Client:
+ Version: 18.06.1-ce
+ API version: 1.38
+ Go version: go1.10.3
+ Git commit: e68fc7a
+ Built: Sun Sep 9 10:14:56 2018
+ OS/Arch: linux/amd64
+ Experimental: false
-Server:
- Engine:
- Version: 18.06.1-ce
- API version: 1.38 (minimum version 1.12)
- Go version: go1.10.3
- Git commit: e68fc7a
- Built: Sun Sep 9 10:13:21 2018
- OS/Arch: linux/amd64
- Experimental: true
+ Server:
+ Engine:
+ Version: 18.06.1-ce
+ API version: 1.38 (minimum version 1.12)
+ Go version: go1.10.3
+ Git commit: e68fc7a
+ Built: Sun Sep 9 10:13:21 2018
+ OS/Arch: linux/amd64
+ Experimental: true
```
@@ -139,7 +139,7 @@ directory.`, le deamon n'est sans doute pas lancé. Lancez-le :
```
-sudo service docker restart
+ sudo service docker restart
```
@@ -152,7 +152,7 @@ session** :
```
-sudo gpasswd -a $USER docker
+ sudo gpasswd -a $USER docker
```
diff --git a/tutorial/docker-basis/linking.md b/tutorial/docker-basis/linking.md
index 7e0cc55..8ecd04a 100644
--- a/tutorial/docker-basis/linking.md
+++ b/tutorial/docker-basis/linking.md
@@ -43,11 +43,11 @@ leur pilote. Pour consulter la liste de réseaux utilisables, lancez :
```
-42sh$ docker network ls
-NETWORK ID NAME DRIVER SCOPE
-74cedd3ff385 bridge bridge local
-d5d907add6e2 host host local
-16b702ed01a0 none null local
+ 42sh$ docker network ls
+ NETWORK ID NAME DRIVER SCOPE
+ 74cedd3ff385 bridge bridge local
+ d5d907add6e2 host host local
+ 16b702ed01a0 none null local
```
@@ -79,7 +79,7 @@ relatives aux objets Docker `network` :
diff --git a/tutorial/docker-basis/rendu.md b/tutorial/docker-basis/rendu.md
index c1a0950..2e09de5 100644
--- a/tutorial/docker-basis/rendu.md
+++ b/tutorial/docker-basis/rendu.md
@@ -39,12 +39,12 @@ a pu voir durant ce premier cours.
```
-42sh$ ./mycloud-run.sh
-http://localhost:12345/
-42sh$ #docker kill db
-42sh$ ./mycloud-run.sh # le script relancera une base de données,
- # sans avoir perdu les données
-http://localhost:12345/
+ 42sh$ ./mycloud-run.sh
+ http://localhost:12345/
+ 42sh$ #docker kill db
+ 42sh$ ./mycloud-run.sh # le script relancera une base de données,
+ # sans avoir perdu les données
+ http://localhost:12345/
```
@@ -110,12 +110,12 @@ Si vous recevez un rapport avec l'erreur suivante :
```
-[FAIL] Bad signature. Here is the gnupg output:
+ [FAIL] Bad signature. Here is the gnupg output:
-gpg: Signature made Tue Jan 01 16:42:23 2014 CET
-gpg: using RSA key 842807A84573CC96
-gpg: requesting key E2CCD99DD37BD32E from hkp server pool.sks-keyservers.net
-gpg: Can't check signature: No public key
+ gpg: Signature made Tue Jan 01 16:42:23 2014 CET
+ gpg: using RSA key 842807A84573CC96
+ gpg: requesting key E2CCD99DD37BD32E from hkp server pool.sks-keyservers.net
+ gpg: Can't check signature: No public key
```
@@ -132,7 +132,7 @@ Si vous recevez un rapport avec l'erreur suivante :
```
-[FAIL] The username of your key is not explicit, I can't find you.
+ [FAIL] The username of your key is not explicit, I can't find you.
```
@@ -147,7 +147,7 @@ Si vous recevez un rapport concluant ainsi :
```
-After analyzing your e-mail, I've decided to SKIP it.
+ After analyzing your e-mail, I've decided to SKIP it.
```
diff --git a/tutorial/docker-basis/volumes.md b/tutorial/docker-basis/volumes.md
index 9b25698..2847284 100644
--- a/tutorial/docker-basis/volumes.md
+++ b/tutorial/docker-basis/volumes.md
@@ -29,7 +29,7 @@ serveur web :
+
+
diff --git a/tutorial/docker-orchestration/disp/overlay_constructs.jpg b/tutorial/docker-orchestration/disp/overlay_constructs.jpg
new file mode 100644
index 0000000..fffe07f
Binary files /dev/null and b/tutorial/docker-orchestration/disp/overlay_constructs.jpg differ
diff --git a/tutorial/docker-orchestration/disp/two_dm_container.jpg b/tutorial/docker-orchestration/disp/two_dm_container.jpg
new file mode 100644
index 0000000..18d840d
Binary files /dev/null and b/tutorial/docker-orchestration/disp/two_dm_container.jpg differ
diff --git a/tutorial/docker-orchestration/machine.md b/tutorial/docker-orchestration/machine.md
index 4a803d9..38892e9 100644
--- a/tutorial/docker-orchestration/machine.md
+++ b/tutorial/docker-orchestration/machine.md
@@ -56,7 +56,7 @@ leur nom vous permettra par exemple de relancer une machine plus tard) :
@@ -82,13 +82,13 @@ changer de daamon/machine avec une simple commande :
```shell
-$ docker container ls
-CONTAINER ID IMAGE COMMAND CREATED STATUS
-$ eval $(docker-machine env echinoidea)
-$ docker container ls -a
-CONTAINER ID IMAGE COMMAND CREATED STATUS
-a814293b9f45 armbuild/busybox "/bin/sh" 18 seconds ago Up 10 minutes
-0caddeed5037 armbuild/alpine "/bin/sh" 2 weeks ago Created
+ $ docker container ls
+ CONTAINER ID IMAGE COMMAND CREATED STATUS
+ $ eval $(docker-machine env echinoidea)
+ $ docker container ls -a
+ CONTAINER ID IMAGE COMMAND CREATED STATUS
+ a814293b9f45 armbuild/busybox "/bin/sh" 18 seconds ago Up 10 minutes
+ 0caddeed5037 armbuild/alpine "/bin/sh" 2 weeks ago Created
```
@@ -142,9 +142,9 @@ virtuelle écoute :
```shell
-(virt1) 42sh$ netstat -tpln | grep dockerd
-Proto Recv-Q Send-Q Local Address Foreign Address PID/Program name
-tcp 0 0 :::2376 :::* 980/dockerd
+ (virt1) 42sh$ netstat -tpln | grep dockerd
+ Proto Recv-Q Send-Q Local Address Foreign Address PID/Program name
+ tcp 0 0 :::2376 :::* 980/dockerd
```
@@ -152,9 +152,9 @@ Essayons de renseigner simplement cette configuration à notre client Docker :
```shell
-(main) 42sh$ docker -H tcp://$VM1_IP:2376/ info
-Get http://$VM1_IP:2376/v1.32/info: net/http: HTTP/1.x transport connection broken: malformed HTTP response "\x15\x03\x01\x00\x02\x02".
-* Are you trying to connect to a TLS-enabled daemon without TLS?
+ (main) 42sh$ docker -H tcp://$VM1_IP:2376/ info
+ Get http://$VM1_IP:2376/v1.32/info: net/http: HTTP/1.x transport connection broken: malformed HTTP response "\x15\x03\x01\x00\x02\x02".
+ * Are you trying to connect to a TLS-enabled daemon without TLS?
```
@@ -174,11 +174,11 @@ nous n'avons qu'à recopier la clef et les certificats en place.
@@ -186,7 +186,7 @@ Tentons maintenant de nous connecter au daemon distant en utilisant ces élémen
```shell
-42sh$ DOCKER_CERT_PATH=remote/virt1/ docker -H tcp://$VM1_IP:2376/ --tlsverify info
+ 42sh$ DOCKER_CERT_PATH=remote/virt1/ docker -H tcp://$VM1_IP:2376/ --tlsverify info
```
diff --git a/tutorial/docker-orchestration/misc/chronograf/Dockerfile b/tutorial/docker-orchestration/misc/chronograf/Dockerfile
new file mode 100644
index 0000000..7050f26
--- /dev/null
+++ b/tutorial/docker-orchestration/misc/chronograf/Dockerfile
@@ -0,0 +1,15 @@
+FROM debian
+
+ENV CHRONOGRAF_VERSION 1.0.0
+RUN apt-get update && apt-get install -y wget && \
+ apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
+ wget -q https://dl.influxdata.com/chronograf/releases/chronograf_${CHRONOGRAF_VERSION}_amd64.deb && \
+ dpkg -i chronograf_${CHRONOGRAF_VERSION}_amd64.deb && \
+ rm -f chronograf_${CHRONOGRAF_VERSION}_amd64.deb
+COPY chronograf.conf /etc/chronograf/chronograf.conf
+
+EXPOSE 10000
+
+VOLUME /var/lib/chronograf
+
+CMD ["/opt/chronograf/chronograf"]
diff --git a/tutorial/docker-orchestration/misc/chronograf/chronograf.conf b/tutorial/docker-orchestration/misc/chronograf/chronograf.conf
new file mode 100644
index 0000000..bd76988
--- /dev/null
+++ b/tutorial/docker-orchestration/misc/chronograf/chronograf.conf
@@ -0,0 +1,2 @@
+Bind="0.0.0.0:10000"
+LocalDatabase="/var/lib/chronograf/chronograf.db"
diff --git a/tutorial/docker-orchestration/misc/docker-compose-std.yml b/tutorial/docker-orchestration/misc/docker-compose-std.yml
new file mode 100644
index 0000000..18479e9
--- /dev/null
+++ b/tutorial/docker-orchestration/misc/docker-compose-std.yml
@@ -0,0 +1,31 @@
+version: '2'
+
+services:
+ influxdb:
+ build: influxdb
+ ports:
+ - "8083:8083"
+ - "8086:8086"
+ volumes:
+ - influx-data:/var/lib/influxdb
+ networks:
+ - influx
+
+ chronograf:
+ build: chronograf
+ ports:
+ - "10000:10000"
+ volumes:
+ - chronograf-data:/var/lib/chronograf
+ networks:
+ - influx
+
+volumes:
+ influx-data:
+ driver: local
+ chronograf-data:
+ driver: local
+
+networks:
+ influx:
+ driver: bridge
diff --git a/tutorial/docker-orchestration/misc/docker-compose-tick.yml b/tutorial/docker-orchestration/misc/docker-compose-tick.yml
new file mode 100644
index 0000000..221e970
--- /dev/null
+++ b/tutorial/docker-orchestration/misc/docker-compose-tick.yml
@@ -0,0 +1,98 @@
+version: '3'
+services:
+ # FRONT
+ chronograf:
+ # Full tag list: https://hub.docker.com/r/library/chronograf/tags/
+ image: chronograf
+ deploy:
+ replicas: 3
+ placement:
+ constraints:
+ - node.role == manager
+ restart_policy:
+ condition: on-failure
+ environment:
+ INFLUXDB_URL: http://influxdb:8086
+ KAPACITOR_URL: http://kapacitor:9092
+ volumes:
+ # Mount for chronograf database
+ - chronograf-data:/var/lib/chronograf
+ ports:
+ # The WebUI for Chronograf is served on port 8888
+ - "8888:8888"
+ networks:
+ - influx
+ depends_on:
+ - kapacitor
+ - influxdb
+ # MIDDLE
+ kapacitor:
+ # Full tag list: https://hub.docker.com/r/library/kapacitor/tags/
+ image: kapacitor
+ deploy:
+ replicas: 1
+ placement:
+ constraints:
+ - node.role == manager
+ restart_policy:
+ condition: on-failure
+ environment:
+ HOSTNAME: kapacitor
+ KAPACITOR_INFLUXDB_0_URLS_0: http://influxdb:8086
+ volumes:
+ # Mount for kapacitor data directory
+ - kapacitor-data:/var/lib/kapacitor
+ # Mount for kapacitor configuration
+ #- /etc/kapacitor/config:/etc/kapacitor
+ ports:
+ # The API for Kapacitor is served on port 9092
+ - "9092:9092"
+ networks:
+ - influx
+ depends_on:
+ - influxdb
+ # BACK
+ telegraf:
+ # Full tag list: https://hub.docker.com/r/library/telegraf/tags/
+ image: telegraf
+ deploy:
+ mode: global
+ restart_policy:
+ condition: on-failure
+ volumes:
+ # Mount for telegraf configuration
+ - ./telegraf.conf:/etc/telegraf/telegraf.conf
+ # Mount for Docker API access
+ - /var/run/docker.sock:/var/run/docker.sock
+ networks:
+ - influx
+ depends_on:
+ - influxdb
+ # DATABASE
+ influxdb:
+ # Full tag list: https://hub.docker.com/r/library/influxdb/tags/
+ image: influxdb
+ deploy:
+ replicas: 1
+ placement:
+ constraints:
+ - node.role == manager
+ restart_policy:
+ condition: on-failure
+ volumes:
+ # Mount for influxdb data directory
+ - influxdb-data:/var/lib/influxdb
+ # Mount for influxdb configuration
+ #- /etc/influxdb/config:/etc/influxdb
+ ports:
+ # The API for InfluxDB is served on port 8086
+ - "8086:8086"
+ networks:
+ - influx
+networks:
+ influx:
+
+volumes:
+ chronograf-data:
+ kapacitor-data:
+ influxdb-data:
diff --git a/tutorial/docker-orchestration/misc/docker-compose.yml b/tutorial/docker-orchestration/misc/docker-compose.yml
new file mode 100644
index 0000000..7defb69
--- /dev/null
+++ b/tutorial/docker-orchestration/misc/docker-compose.yml
@@ -0,0 +1,35 @@
+version: '3'
+
+services:
+ influxdb:
+ image: influxdb
+ ports:
+ - "8083:8083"
+ - "8086:8086"
+ volumes:
+ - influx-data:/var/lib/influxdb
+ networks:
+ - influx
+
+ chronograf:
+ image: chronograf
+ ports:
+ - "8888:8888"
+ environment:
+ INFLUXDB_URL: http://influxdb:8086
+ KAPACITOR_URL: http://kapacitor:9092
+ volumes:
+ - chronograf-data:/var/lib/chronograf
+ networks:
+ - influx
+ depends_on:
+ - influxdb
+
+volumes:
+ influx-data:
+ driver: local
+ chronograf-data:
+ driver: local
+
+networks:
+ influx:
diff --git a/tutorial/docker-orchestration/misc/influxdb/Dockerfile b/tutorial/docker-orchestration/misc/influxdb/Dockerfile
new file mode 100644
index 0000000..95ec741
--- /dev/null
+++ b/tutorial/docker-orchestration/misc/influxdb/Dockerfile
@@ -0,0 +1,15 @@
+FROM debian
+
+ENV INFLUXDB_VERSION 1.0.0
+RUN apt-get update && apt-get install -y wget && \
+ apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
+ wget -q https://dl.influxdata.com/influxdb/releases/influxdb_${INFLUXDB_VERSION}_amd64.deb && \
+ dpkg -i influxdb_${INFLUXDB_VERSION}_amd64.deb && \
+ rm -f influxdb_${INFLUXDB_VERSION}_amd64.deb
+COPY influxdb.conf /etc/influxdb/influxdb.conf
+
+EXPOSE 8083 8086
+
+VOLUME /var/lib/influxdb
+
+CMD ["influxd"]
diff --git a/tutorial/docker-orchestration/misc/influxdb/influxdb.conf b/tutorial/docker-orchestration/misc/influxdb/influxdb.conf
new file mode 100644
index 0000000..1e039ab
--- /dev/null
+++ b/tutorial/docker-orchestration/misc/influxdb/influxdb.conf
@@ -0,0 +1,10 @@
+[meta]
+ dir = "/var/lib/influxdb/meta"
+
+[data]
+ dir = "/var/lib/influxdb/data"
+ engine = "tsm1"
+ wal-dir = "/var/lib/influxdb/wal"
+
+[admin]
+ enabled = true
\ No newline at end of file
diff --git a/tutorial/docker-orchestration/misc/mymonitoring-supervisor/Dockerfile b/tutorial/docker-orchestration/misc/mymonitoring-supervisor/Dockerfile
new file mode 100644
index 0000000..7fa41d1
--- /dev/null
+++ b/tutorial/docker-orchestration/misc/mymonitoring-supervisor/Dockerfile
@@ -0,0 +1,22 @@
+FROM debian
+
+ENV INFLUXDB_VERSION 1.0.0
+ENV CHRONOGRAF_VERSION 1.0.0
+RUN apt-get update && apt-get install -y wget supervisor && \
+ apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
+ wget -q https://dl.influxdata.com/influxdb/releases/influxdb_${INFLUXDB_VERSION}_amd64.deb && \
+ wget -q https://dl.influxdata.com/chronograf/releases/chronograf_${CHRONOGRAF_VERSION}_amd64.deb && \
+ dpkg -i influxdb_${INFLUXDB_VERSION}_amd64.deb chronograf_${CHRONOGRAF_VERSION}_amd64.deb && \
+ rm -f influxdb_${INFLUXDB_VERSION}_amd64.deb chronograf_${CHRONOGRAF_VERSION}_amd64.deb
+
+EXPOSE 8083 8086 10000
+
+VOLUME /var/lib/influxdb
+VOLUME /var/lib/chronograf
+
+COPY influxdb.conf /etc/influxdb/influxdb.conf
+COPY chronograf.conf /etc/chronograf/chronograf.conf
+
+COPY supervisor.conf /etc/supervisor/conf.d/supervisord.conf
+
+CMD ["/usr/bin/supervisord"]
diff --git a/tutorial/docker-orchestration/misc/mymonitoring-supervisor/chronograf.conf b/tutorial/docker-orchestration/misc/mymonitoring-supervisor/chronograf.conf
new file mode 100644
index 0000000..bd76988
--- /dev/null
+++ b/tutorial/docker-orchestration/misc/mymonitoring-supervisor/chronograf.conf
@@ -0,0 +1,2 @@
+Bind="0.0.0.0:10000"
+LocalDatabase="/var/lib/chronograf/chronograf.db"
diff --git a/tutorial/docker-orchestration/misc/mymonitoring-supervisor/influxdb.conf b/tutorial/docker-orchestration/misc/mymonitoring-supervisor/influxdb.conf
new file mode 100644
index 0000000..1e039ab
--- /dev/null
+++ b/tutorial/docker-orchestration/misc/mymonitoring-supervisor/influxdb.conf
@@ -0,0 +1,10 @@
+[meta]
+ dir = "/var/lib/influxdb/meta"
+
+[data]
+ dir = "/var/lib/influxdb/data"
+ engine = "tsm1"
+ wal-dir = "/var/lib/influxdb/wal"
+
+[admin]
+ enabled = true
\ No newline at end of file
diff --git a/tutorial/docker-orchestration/misc/mymonitoring-supervisor/supervisor.conf b/tutorial/docker-orchestration/misc/mymonitoring-supervisor/supervisor.conf
new file mode 100644
index 0000000..e18f88e
--- /dev/null
+++ b/tutorial/docker-orchestration/misc/mymonitoring-supervisor/supervisor.conf
@@ -0,0 +1,8 @@
+[supervisord]
+nodaemon=true
+
+[program:influxdb]
+command=/usr/bin/influxd
+
+[program:chronograf]
+command=/opt/chronograf/chronograf
diff --git a/tutorial/docker-orchestration/misc/mymonitoring-wait/Dockerfile b/tutorial/docker-orchestration/misc/mymonitoring-wait/Dockerfile
new file mode 100644
index 0000000..b96d50f
--- /dev/null
+++ b/tutorial/docker-orchestration/misc/mymonitoring-wait/Dockerfile
@@ -0,0 +1,23 @@
+FROM debian
+
+ENV INFLUXDB_VERSION 1.0.0
+ENV CHRONOGRAF_VERSION 1.0.0
+RUN apt-get update && apt-get install -y wget && \
+ apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
+ wget -q https://dl.influxdata.com/influxdb/releases/influxdb_${INFLUXDB_VERSION}_amd64.deb && \
+ wget -q https://dl.influxdata.com/chronograf/releases/chronograf_${CHRONOGRAF_VERSION}_amd64.deb && \
+ dpkg -i influxdb_${INFLUXDB_VERSION}_amd64.deb chronograf_${CHRONOGRAF_VERSION}_amd64.deb && \
+ rm -f influxdb_${INFLUXDB_VERSION}_amd64.deb chronograf_${CHRONOGRAF_VERSION}_amd64.deb
+
+EXPOSE 8083 8086 10000
+
+VOLUME /var/lib/influxdb
+VOLUME /var/lib/chronograf
+
+COPY influxdb.conf /etc/influxdb/influxdb.conf
+COPY chronograf.conf /etc/chronograf/chronograf.conf
+
+# start.sh should already be executable
+COPY start.sh /usr/bin/start.sh
+
+CMD ["start.sh"]
diff --git a/tutorial/docker-orchestration/misc/mymonitoring-wait/chronograf.conf b/tutorial/docker-orchestration/misc/mymonitoring-wait/chronograf.conf
new file mode 100644
index 0000000..bd76988
--- /dev/null
+++ b/tutorial/docker-orchestration/misc/mymonitoring-wait/chronograf.conf
@@ -0,0 +1,2 @@
+Bind="0.0.0.0:10000"
+LocalDatabase="/var/lib/chronograf/chronograf.db"
diff --git a/tutorial/docker-orchestration/misc/mymonitoring-wait/influxdb.conf b/tutorial/docker-orchestration/misc/mymonitoring-wait/influxdb.conf
new file mode 100644
index 0000000..1e039ab
--- /dev/null
+++ b/tutorial/docker-orchestration/misc/mymonitoring-wait/influxdb.conf
@@ -0,0 +1,10 @@
+[meta]
+ dir = "/var/lib/influxdb/meta"
+
+[data]
+ dir = "/var/lib/influxdb/data"
+ engine = "tsm1"
+ wal-dir = "/var/lib/influxdb/wal"
+
+[admin]
+ enabled = true
\ No newline at end of file
diff --git a/tutorial/docker-orchestration/misc/mymonitoring-wait/start.sh b/tutorial/docker-orchestration/misc/mymonitoring-wait/start.sh
new file mode 100755
index 0000000..d37e5bd
--- /dev/null
+++ b/tutorial/docker-orchestration/misc/mymonitoring-wait/start.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+influxd &
+WAIT=$!
+
+/opt/chronograf/chronograf &
+WAIT="${WAIT} $!"
+
+wait ${WAIT}
diff --git a/tutorial/docker-orchestration/misc/proj/docker-compose.yml b/tutorial/docker-orchestration/misc/proj/docker-compose.yml
new file mode 100644
index 0000000..990e3a7
--- /dev/null
+++ b/tutorial/docker-orchestration/misc/proj/docker-compose.yml
@@ -0,0 +1,24 @@
+version: '2'
+
+services:
+ nginx:
+ image: nginx
+ ports:
+ - "80:8080"
+ networks:
+ - ha
+
+ mysql:
+ image: mysql
+ volumes:
+ - mysql-data:/var/lib/mysql
+ networks:
+ - ha
+
+volumes:
+ mysql-data:
+ driver: local
+
+networks:
+ ha:
+ driver: bridge
diff --git a/tutorial/docker-orchestration/misc/telegraf.conf b/tutorial/docker-orchestration/misc/telegraf.conf
new file mode 100644
index 0000000..c331683
--- /dev/null
+++ b/tutorial/docker-orchestration/misc/telegraf.conf
@@ -0,0 +1,3 @@
+[[outputs.influxdb]]
+urls = ["http://influxdb:8086"] # required
+database = "telegraf" # required
\ No newline at end of file
diff --git a/tutorial/docker-orchestration/misc/telegraf/etc/logrotate.d/telegraf b/tutorial/docker-orchestration/misc/telegraf/etc/logrotate.d/telegraf
new file mode 100644
index 0000000..f34017f
--- /dev/null
+++ b/tutorial/docker-orchestration/misc/telegraf/etc/logrotate.d/telegraf
@@ -0,0 +1,11 @@
+/var/log/telegraf/telegraf.log
+{
+ rotate 6
+ daily
+ missingok
+ dateext
+ copytruncate
+ notifempty
+ compress
+}
+
diff --git a/tutorial/docker-orchestration/misc/telegraf/etc/telegraf/telegraf.conf b/tutorial/docker-orchestration/misc/telegraf/etc/telegraf/telegraf.conf
new file mode 100644
index 0000000..980ad3e
--- /dev/null
+++ b/tutorial/docker-orchestration/misc/telegraf/etc/telegraf/telegraf.conf
@@ -0,0 +1,1836 @@
+# Telegraf Configuration
+#
+# Telegraf is entirely plugin driven. All metrics are gathered from the
+# declared inputs, and sent to the declared outputs.
+#
+# Plugins must be declared in here to be active.
+# To deactivate a plugin, comment out the name and any variables.
+#
+# Use 'telegraf -config telegraf.conf -test' to see what metrics a config
+# file would generate.
+#
+# Environment variables can be used anywhere in this config file, simply prepend
+# them with $. For strings the variable must be within quotes (ie, "$STR_VAR"),
+# for numbers and booleans they should be plain (ie, $INT_VAR, $BOOL_VAR)
+
+
+# Global tags can be specified here in key="value" format.
+[global_tags]
+ # dc = "us-east-1" # will tag all metrics with dc=us-east-1
+ # rack = "1a"
+ ## Environment variables can be used as tags, and throughout the config file
+ # user = "$USER"
+
+
+# Configuration for telegraf agent
+[agent]
+ ## Default data collection interval for all inputs
+ interval = "10s"
+ ## Rounds collection interval to 'interval'
+ ## ie, if interval="10s" then always collect on :00, :10, :20, etc.
+ round_interval = true
+
+ ## Telegraf will send metrics to outputs in batches of at
+ ## most metric_batch_size metrics.
+ metric_batch_size = 1000
+ ## For failed writes, telegraf will cache metric_buffer_limit metrics for each
+ ## output, and will flush this buffer on a successful write. Oldest metrics
+ ## are dropped first when this buffer fills.
+ metric_buffer_limit = 10000
+
+ ## Collection jitter is used to jitter the collection by a random amount.
+ ## Each plugin will sleep for a random time within jitter before collecting.
+ ## This can be used to avoid many plugins querying things like sysfs at the
+ ## same time, which can have a measurable effect on the system.
+ collection_jitter = "0s"
+
+ ## Default flushing interval for all outputs. You shouldn't set this below
+ ## interval. Maximum flush_interval will be flush_interval + flush_jitter
+ flush_interval = "10s"
+ ## Jitter the flush interval by a random amount. This is primarily to avoid
+ ## large write spikes for users running a large number of telegraf instances.
+ ## ie, a jitter of 5s and interval 10s means flushes will happen every 10-15s
+ flush_jitter = "0s"
+
+ ## By default, precision will be set to the same timestamp order as the
+ ## collection interval, with the maximum being 1s.
+ ## Precision will NOT be used for service inputs, such as logparser and statsd.
+ ## Valid values are "ns", "us" (or "µs"), "ms", "s".
+ precision = ""
+ ## Run telegraf in debug mode
+ debug = false
+ ## Run telegraf in quiet mode
+ quiet = false
+ ## Override default hostname, if empty use os.Hostname()
+ hostname = ""
+ ## If set to true, do no set the "host" tag in the telegraf agent.
+ omit_hostname = false
+
+
+###############################################################################
+# OUTPUT PLUGINS #
+###############################################################################
+
+# Configuration for influxdb server to send metrics to
+[[outputs.influxdb]]
+ ## The full HTTP or UDP endpoint URL for your InfluxDB instance.
+ ## Multiple urls can be specified as part of the same cluster,
+ ## this means that only ONE of the urls will be written to each interval.
+ # urls = ["udp://localhost:8089"] # UDP endpoint example
+ urls = ["http://localhost:8086"] # required
+ ## The target database for metrics (telegraf will create it if not exists).
+ database = "telegraf" # required
+
+ ## Retention policy to write to. Empty string writes to the default rp.
+ retention_policy = ""
+ ## Write consistency (clusters only), can be: "any", "one", "quorum", "all"
+ write_consistency = "any"
+
+ ## Write timeout (for the InfluxDB client), formatted as a string.
+ ## If not provided, will default to 5s. 0s means no timeout (not recommended).
+ timeout = "5s"
+ # username = "telegraf"
+ # password = "metricsmetricsmetricsmetrics"
+ ## Set the user agent for HTTP POSTs (can be useful for log differentiation)
+ # user_agent = "telegraf"
+ ## Set UDP payload size, defaults to InfluxDB UDP Client default (512 bytes)
+ # udp_payload = 512
+
+ ## Optional SSL Config
+ # ssl_ca = "/etc/telegraf/ca.pem"
+ # ssl_cert = "/etc/telegraf/cert.pem"
+ # ssl_key = "/etc/telegraf/key.pem"
+ ## Use SSL but skip chain & host verification
+ # insecure_skip_verify = false
+
+
+# # Configuration for Amon Server to send metrics to.
+# [[outputs.amon]]
+# ## Amon Server Key
+# server_key = "my-server-key" # required.
+#
+# ## Amon Instance URL
+# amon_instance = "https://youramoninstance" # required
+#
+# ## Connection timeout.
+# # timeout = "5s"
+
+
+# # Configuration for the AMQP server to send metrics to
+# [[outputs.amqp]]
+# ## AMQP url
+# url = "amqp://localhost:5672/influxdb"
+# ## AMQP exchange
+# exchange = "telegraf"
+# ## Auth method. PLAIN and EXTERNAL are supported
+# # auth_method = "PLAIN"
+# ## Telegraf tag to use as a routing key
+# ## ie, if this tag exists, it's value will be used as the routing key
+# routing_tag = "host"
+#
+# ## InfluxDB retention policy
+# # retention_policy = "default"
+# ## InfluxDB database
+# # database = "telegraf"
+# ## InfluxDB precision
+# # precision = "s"
+#
+# ## Optional SSL Config
+# # ssl_ca = "/etc/telegraf/ca.pem"
+# # ssl_cert = "/etc/telegraf/cert.pem"
+# # ssl_key = "/etc/telegraf/key.pem"
+# ## Use SSL but skip chain & host verification
+# # insecure_skip_verify = false
+#
+# ## Data format to output.
+# ## Each data format has it's own unique set of configuration options, read
+# ## more about them here:
+# ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md
+# data_format = "influx"
+
+
+# # Configuration for AWS CloudWatch output.
+# [[outputs.cloudwatch]]
+# ## Amazon REGION
+# region = 'us-east-1'
+#
+# ## Amazon Credentials
+# ## Credentials are loaded in the following order
+# ## 1) Assumed credentials via STS if role_arn is specified
+# ## 2) explicit credentials from 'access_key' and 'secret_key'
+# ## 3) shared profile from 'profile'
+# ## 4) environment variables
+# ## 5) shared credentials file
+# ## 6) EC2 Instance Profile
+# #access_key = ""
+# #secret_key = ""
+# #token = ""
+# #role_arn = ""
+# #profile = ""
+# #shared_credential_file = ""
+#
+# ## Namespace for the CloudWatch MetricDatums
+# namespace = 'InfluxData/Telegraf'
+
+
+# # Configuration for DataDog API to send metrics to.
+# [[outputs.datadog]]
+# ## Datadog API key
+# apikey = "my-secret-key" # required.
+#
+# ## Connection timeout.
+# # timeout = "5s"
+
+
+# # Send telegraf metrics to file(s)
+# [[outputs.file]]
+# ## Files to write to, "stdout" is a specially handled file.
+# files = ["stdout", "/tmp/metrics.out"]
+#
+# ## Data format to output.
+# ## Each data format has it's own unique set of configuration options, read
+# ## more about them here:
+# ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md
+# data_format = "influx"
+
+
+# # Configuration for Graphite server to send metrics to
+# [[outputs.graphite]]
+# ## TCP endpoint for your graphite instance.
+# ## If multiple endpoints are configured, output will be load balanced.
+# ## Only one of the endpoints will be written to with each iteration.
+# servers = ["localhost:2003"]
+# ## Prefix metrics name
+# prefix = ""
+# ## Graphite output template
+# ## see https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md
+# template = "host.tags.measurement.field"
+# ## timeout in seconds for the write connection to graphite
+# timeout = 2
+
+
+# # Send telegraf metrics to graylog(s)
+# [[outputs.graylog]]
+# ## Udp endpoint for your graylog instance.
+# servers = ["127.0.0.1:12201", "192.168.1.1:12201"]
+
+
+# # Configuration for sending metrics to an Instrumental project
+# [[outputs.instrumental]]
+# ## Project API Token (required)
+# api_token = "API Token" # required
+# ## Prefix the metrics with a given name
+# prefix = ""
+# ## Stats output template (Graphite formatting)
+# ## see https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md#graphite
+# template = "host.tags.measurement.field"
+# ## Timeout in seconds to connect
+# timeout = "2s"
+# ## Display Communcation to Instrumental
+# debug = false
+
+
+# # Configuration for the Kafka server to send metrics to
+# [[outputs.kafka]]
+# ## URLs of kafka brokers
+# brokers = ["localhost:9092"]
+# ## Kafka topic for producer messages
+# topic = "telegraf"
+# ## Telegraf tag to use as a routing key
+# ## ie, if this tag exists, it's value will be used as the routing key
+# routing_tag = "host"
+#
+# ## CompressionCodec represents the various compression codecs recognized by
+# ## Kafka in messages.
+# ## 0 : No compression
+# ## 1 : Gzip compression
+# ## 2 : Snappy compression
+# compression_codec = 0
+#
+# ## RequiredAcks is used in Produce Requests to tell the broker how many
+# ## replica acknowledgements it must see before responding
+# ## 0 : the producer never waits for an acknowledgement from the broker.
+# ## This option provides the lowest latency but the weakest durability
+# ## guarantees (some data will be lost when a server fails).
+# ## 1 : the producer gets an acknowledgement after the leader replica has
+# ## received the data. This option provides better durability as the
+# ## client waits until the server acknowledges the request as successful
+# ## (only messages that were written to the now-dead leader but not yet
+# ## replicated will be lost).
+# ## -1: the producer gets an acknowledgement after all in-sync replicas have
+# ## received the data. This option provides the best durability, we
+# ## guarantee that no messages will be lost as long as at least one in
+# ## sync replica remains.
+# required_acks = -1
+#
+# ## The total number of times to retry sending a message
+# max_retry = 3
+#
+# ## Optional SSL Config
+# # ssl_ca = "/etc/telegraf/ca.pem"
+# # ssl_cert = "/etc/telegraf/cert.pem"
+# # ssl_key = "/etc/telegraf/key.pem"
+# ## Use SSL but skip chain & host verification
+# # insecure_skip_verify = false
+#
+# ## Data format to output.
+# ## Each data format has it's own unique set of configuration options, read
+# ## more about them here:
+# ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md
+# data_format = "influx"
+
+
+# # Configuration for the AWS Kinesis output.
+# [[outputs.kinesis]]
+# ## Amazon REGION of kinesis endpoint.
+# region = "ap-southeast-2"
+#
+# ## Amazon Credentials
+# ## Credentials are loaded in the following order
+# ## 1) Assumed credentials via STS if role_arn is specified
+# ## 2) explicit credentials from 'access_key' and 'secret_key'
+# ## 3) shared profile from 'profile'
+# ## 4) environment variables
+# ## 5) shared credentials file
+# ## 6) EC2 Instance Profile
+# #access_key = ""
+# #secret_key = ""
+# #token = ""
+# #role_arn = ""
+# #profile = ""
+# #shared_credential_file = ""
+#
+# ## Kinesis StreamName must exist prior to starting telegraf.
+# streamname = "StreamName"
+# ## PartitionKey as used for sharding data.
+# partitionkey = "PartitionKey"
+# ## format of the Data payload in the kinesis PutRecord, supported
+# ## String and Custom.
+# format = "string"
+# ## debug will show upstream aws messages.
+# debug = false
+
+
+# # Configuration for Librato API to send metrics to.
+# [[outputs.librato]]
+# ## Librator API Docs
+# ## http://dev.librato.com/v1/metrics-authentication
+# ## Librato API user
+# api_user = "telegraf@influxdb.com" # required.
+# ## Librato API token
+# api_token = "my-secret-token" # required.
+# ## Debug
+# # debug = false
+# ## Connection timeout.
+# # timeout = "5s"
+# ## Output source Template (same as graphite buckets)
+# ## see https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md#graphite
+# ## This template is used in librato's source (not metric's name)
+# template = "host"
+#
+
+
+# # Configuration for MQTT server to send metrics to
+# [[outputs.mqtt]]
+# servers = ["localhost:1883"] # required.
+#
+# ## MQTT outputs send metrics to this topic format
+# ## "///"
+# ## ex: prefix/web01.example.com/mem
+# topic_prefix = "telegraf"
+#
+# ## username and password to connect MQTT server.
+# # username = "telegraf"
+# # password = "metricsmetricsmetricsmetrics"
+#
+# ## Optional SSL Config
+# # ssl_ca = "/etc/telegraf/ca.pem"
+# # ssl_cert = "/etc/telegraf/cert.pem"
+# # ssl_key = "/etc/telegraf/key.pem"
+# ## Use SSL but skip chain & host verification
+# # insecure_skip_verify = false
+#
+# ## Data format to output.
+# ## Each data format has it's own unique set of configuration options, read
+# ## more about them here:
+# ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md
+# data_format = "influx"
+
+
+# # Send telegraf measurements to NSQD
+# [[outputs.nsq]]
+# ## Location of nsqd instance listening on TCP
+# server = "localhost:4150"
+# ## NSQ topic for producer messages
+# topic = "telegraf"
+#
+# ## Data format to output.
+# ## Each data format has it's own unique set of configuration options, read
+# ## more about them here:
+# ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md
+# data_format = "influx"
+
+
+# # Configuration for OpenTSDB server to send metrics to
+# [[outputs.opentsdb]]
+# ## prefix for metrics keys
+# prefix = "my.specific.prefix."
+#
+# ## Telnet Mode ##
+# ## DNS name of the OpenTSDB server in telnet mode
+# host = "opentsdb.example.com"
+#
+# ## Port of the OpenTSDB server in telnet mode
+# port = 4242
+#
+# ## Debug true - Prints OpenTSDB communication
+# debug = false
+
+
+# # Configuration for the Prometheus client to spawn
+# [[outputs.prometheus_client]]
+# ## Address to listen on
+# # listen = ":9126"
+
+
+# # Configuration for the Riemann server to send metrics to
+# [[outputs.riemann]]
+# ## URL of server
+# url = "localhost:5555"
+# ## transport protocol to use either tcp or udp
+# transport = "tcp"
+# ## separator to use between input name and field name in Riemann service name
+# separator = " "
+
+
+
+###############################################################################
+# INPUT PLUGINS #
+###############################################################################
+
+# Read metrics about cpu usage
+[[inputs.cpu]]
+ ## Whether to report per-cpu stats or not
+ percpu = true
+ ## Whether to report total system cpu stats or not
+ totalcpu = true
+ ## Comment this line if you want the raw CPU time metrics
+ fielddrop = ["time_*"]
+
+
+# Read metrics about disk usage by mount point
+[[inputs.disk]]
+ ## By default, telegraf gather stats for all mountpoints.
+ ## Setting mountpoints will restrict the stats to the specified mountpoints.
+ # mount_points = ["/"]
+
+ ## Ignore some mountpoints by filesystem type. For example (dev)tmpfs (usually
+ ## present on /run, /var/run, /dev/shm or /dev).
+ ignore_fs = ["tmpfs", "devtmpfs"]
+
+
+# Read metrics about disk IO by device
+[[inputs.diskio]]
+ ## By default, telegraf will gather stats for all devices including
+ ## disk partitions.
+ ## Setting devices will restrict the stats to the specified devices.
+ # devices = ["sda", "sdb"]
+ ## Uncomment the following line if you need disk serial numbers.
+ # skip_serial_number = false
+
+
+# Get kernel statistics from /proc/stat
+[[inputs.kernel]]
+ # no configuration
+
+
+# Read metrics about memory usage
+[[inputs.mem]]
+ # no configuration
+
+
+# Get the number of processes and group them by status
+[[inputs.processes]]
+ # no configuration
+
+
+# Read metrics about swap memory usage
+[[inputs.swap]]
+ # no configuration
+
+
+# Read metrics about system load & uptime
+[[inputs.system]]
+ # no configuration
+
+
+# # Read stats from aerospike server(s)
+# [[inputs.aerospike]]
+# ## Aerospike servers to connect to (with port)
+# ## This plugin will query all namespaces the aerospike
+# ## server has configured and get stats for them.
+# servers = ["localhost:3000"]
+
+
+# # Read Apache status information (mod_status)
+# [[inputs.apache]]
+# ## An array of Apache status URI to gather stats.
+# ## Default is "http://localhost/server-status?auto".
+# urls = ["http://localhost/server-status?auto"]
+
+
+# # Read metrics of bcache from stats_total and dirty_data
+# [[inputs.bcache]]
+# ## Bcache sets path
+# ## If not specified, then default is:
+# bcachePath = "/sys/fs/bcache"
+#
+# ## By default, telegraf gather stats for all bcache devices
+# ## Setting devices will restrict the stats to the specified
+# ## bcache devices.
+# bcacheDevs = ["bcache0"]
+
+
+# # Read Cassandra metrics through Jolokia
+# [[inputs.cassandra]]
+# # This is the context root used to compose the jolokia url
+# context = "/jolokia/read"
+# ## List of cassandra servers exposing jolokia read service
+# servers = ["myuser:mypassword@10.10.10.1:8778","10.10.10.2:8778",":8778"]
+# ## List of metrics collected on above servers
+# ## Each metric consists of a jmx path.
+# ## This will collect all heap memory usage metrics from the jvm and
+# ## ReadLatency metrics for all keyspaces and tables.
+# ## "type=Table" in the query works with Cassandra3.0. Older versions might
+# ## need to use "type=ColumnFamily"
+# metrics = [
+# "/java.lang:type=Memory/HeapMemoryUsage",
+# "/org.apache.cassandra.metrics:type=Table,keyspace=*,scope=*,name=ReadLatency"
+# ]
+
+
+# # Collects performance metrics from the MON and OSD nodes in a Ceph storage cluster.
+# [[inputs.ceph]]
+# ## All configuration values are optional, defaults are shown below
+#
+# ## location of ceph binary
+# ceph_binary = "/usr/bin/ceph"
+#
+# ## directory in which to look for socket files
+# socket_dir = "/var/run/ceph"
+#
+# ## prefix of MON and OSD socket files, used to determine socket type
+# mon_prefix = "ceph-mon"
+# osd_prefix = "ceph-osd"
+#
+# ## suffix used to identify socket files
+# socket_suffix = "asok"
+
+
+# # Read specific statistics per cgroup
+# [[inputs.cgroup]]
+# ## Directories in which to look for files, globs are supported.
+# # paths = [
+# # "/cgroup/memory",
+# # "/cgroup/memory/child1",
+# # "/cgroup/memory/child2/*",
+# # ]
+# ## cgroup stat fields, as file names, globs are supported.
+# ## these file names are appended to each path from above.
+# # files = ["memory.*usage*", "memory.limit_in_bytes"]
+
+
+# # Pull Metric Statistics from Amazon CloudWatch
+# [[inputs.cloudwatch]]
+# ## Amazon Region
+# region = 'us-east-1'
+#
+# ## Amazon Credentials
+# ## Credentials are loaded in the following order
+# ## 1) Assumed credentials via STS if role_arn is specified
+# ## 2) explicit credentials from 'access_key' and 'secret_key'
+# ## 3) shared profile from 'profile'
+# ## 4) environment variables
+# ## 5) shared credentials file
+# ## 6) EC2 Instance Profile
+# #access_key = ""
+# #secret_key = ""
+# #token = ""
+# #role_arn = ""
+# #profile = ""
+# #shared_credential_file = ""
+#
+# ## Requested CloudWatch aggregation Period (required - must be a multiple of 60s)
+# period = '1m'
+#
+# ## Collection Delay (required - must account for metrics availability via CloudWatch API)
+# delay = '1m'
+#
+# ## Recomended: use metric 'interval' that is a multiple of 'period' to avoid
+# ## gaps or overlap in pulled data
+# interval = '1m'
+#
+# ## Configure the TTL for the internal cache of metrics.
+# ## Defaults to 1 hr if not specified
+# #cache_ttl = '10m'
+#
+# ## Metric Statistic Namespace (required)
+# namespace = 'AWS/ELB'
+#
+# ## Metrics to Pull (optional)
+# ## Defaults to all Metrics in Namespace if nothing is provided
+# ## Refreshes Namespace available metrics every 1h
+# #[[inputs.cloudwatch.metrics]]
+# # names = ['Latency', 'RequestCount']
+# #
+# # ## Dimension filters for Metric (optional)
+# # [[inputs.cloudwatch.metrics.dimensions]]
+# # name = 'LoadBalancerName'
+# # value = 'p-example'
+
+
+# # Gather health check statuses from services registered in Consul
+# [[inputs.consul]]
+# ## Most of these values defaults to the one configured on a Consul's agent level.
+# ## Optional Consul server address (default: "localhost")
+# # address = "localhost"
+# ## Optional URI scheme for the Consul server (default: "http")
+# # scheme = "http"
+# ## Optional ACL token used in every request (default: "")
+# # token = ""
+# ## Optional username used for request HTTP Basic Authentication (default: "")
+# # username = ""
+# ## Optional password used for HTTP Basic Authentication (default: "")
+# # password = ""
+# ## Optional data centre to query the health checks from (default: "")
+# # datacentre = ""
+
+
+# # Read metrics from one or many couchbase clusters
+# [[inputs.couchbase]]
+# ## specify servers via a url matching:
+# ## [protocol://][:password]@address[:port]
+# ## e.g.
+# ## http://couchbase-0.example.com/
+# ## http://admin:secret@couchbase-0.example.com:8091/
+# ##
+# ## If no servers are specified, then localhost is used as the host.
+# ## If no protocol is specifed, HTTP is used.
+# ## If no port is specified, 8091 is used.
+# servers = ["http://localhost:8091"]
+
+
+# # Read CouchDB Stats from one or more servers
+# [[inputs.couchdb]]
+# ## Works with CouchDB stats endpoints out of the box
+# ## Multiple HOSTs from which to read CouchDB stats:
+# hosts = ["http://localhost:8086/_stats"]
+
+
+# # Read metrics from one or many disque servers
+# [[inputs.disque]]
+# ## An array of URI to gather stats about. Specify an ip or hostname
+# ## with optional port and password.
+# ## ie disque://localhost, disque://10.10.3.33:18832, 10.0.0.1:10000, etc.
+# ## If no servers are specified, then localhost is used as the host.
+# servers = ["localhost"]
+
+
+# # Query given DNS server and gives statistics
+# [[inputs.dns_query]]
+# ## servers to query
+# servers = ["8.8.8.8"] # required
+#
+# ## Domains or subdomains to query. "."(root) is default
+# domains = ["."] # optional
+#
+# ## Query record type. Default is "A"
+# ## Posible values: A, AAAA, CNAME, MX, NS, PTR, TXT, SOA, SPF, SRV.
+# record_type = "A" # optional
+#
+# ## Dns server port. 53 is default
+# port = 53 # optional
+#
+# ## Query timeout in seconds. Default is 2 seconds
+# timeout = 2 # optional
+
+
+# # Read metrics about docker containers
+# [[inputs.docker]]
+# ## Docker Endpoint
+# ## To use TCP, set endpoint = "tcp://[ip]:[port]"
+# ## To use environment variables (ie, docker-machine), set endpoint = "ENV"
+# endpoint = "unix:///var/run/docker.sock"
+# ## Only collect metrics for these containers, collect all if empty
+# container_names = []
+# ## Timeout for docker list, info, and stats commands
+# timeout = "5s"
+#
+# ## Whether to report for each container per-device blkio (8:0, 8:1...) and
+# ## network (eth0, eth1, ...) stats or not
+# perdevice = true
+# ## Whether to report for each container total blkio and network stats or not
+# total = false
+#
+
+
+# # Read statistics from one or many dovecot servers
+# [[inputs.dovecot]]
+# ## specify dovecot servers via an address:port list
+# ## e.g.
+# ## localhost:24242
+# ##
+# ## If no servers are specified, then localhost is used as the host.
+# servers = ["localhost:24242"]
+# ## Type is one of "user", "domain", "ip", or "global"
+# type = "global"
+# ## Wildcard matches like "*.com". An empty string "" is same as "*"
+# ## If type = "ip" filters should be
+# filters = [""]
+
+
+# # Read stats from one or more Elasticsearch servers or clusters
+# [[inputs.elasticsearch]]
+# ## specify a list of one or more Elasticsearch servers
+# servers = ["http://localhost:9200"]
+#
+# ## set local to false when you want to read the indices stats from all nodes
+# ## within the cluster
+# local = true
+#
+# ## set cluster_health to true when you want to also obtain cluster level stats
+# cluster_health = false
+#
+# ## Optional SSL Config
+# # ssl_ca = "/etc/telegraf/ca.pem"
+# # ssl_cert = "/etc/telegraf/cert.pem"
+# # ssl_key = "/etc/telegraf/key.pem"
+# ## Use SSL but skip chain & host verification
+# # insecure_skip_verify = false
+
+
+# # Read metrics from one or more commands that can output to stdout
+# [[inputs.exec]]
+# ## Commands array
+# commands = [
+# "/tmp/test.sh",
+# "/usr/bin/mycollector --foo=bar",
+# "/tmp/collect_*.sh"
+# ]
+#
+# ## Timeout for each command to complete.
+# timeout = "5s"
+#
+# ## measurement name suffix (for separating different commands)
+# name_suffix = "_mycollector"
+#
+# ## Data format to consume.
+# ## Each data format has it's own unique set of configuration options, read
+# ## more about them here:
+# ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
+# data_format = "influx"
+
+
+# # Read stats about given file(s)
+# [[inputs.filestat]]
+# ## Files to gather stats about.
+# ## These accept standard unix glob matching rules, but with the addition of
+# ## ** as a "super asterisk". ie:
+# ## "/var/log/**.log" -> recursively find all .log files in /var/log
+# ## "/var/log/*/*.log" -> find all .log files with a parent dir in /var/log
+# ## "/var/log/apache.log" -> just tail the apache log file
+# ##
+# ## See https://github.com/gobwas/glob for more examples
+# ##
+# files = ["/var/log/**.log"]
+# ## If true, read the entire file and calculate an md5 checksum.
+# md5 = false
+
+
+# # Read flattened metrics from one or more GrayLog HTTP endpoints
+# [[inputs.graylog]]
+# ## API endpoint, currently supported API:
+# ##
+# ## - multiple (Ex http://:12900/system/metrics/multiple)
+# ## - namespace (Ex http://:12900/system/metrics/namespace/{namespace})
+# ##
+# ## For namespace endpoint, the metrics array will be ignored for that call.
+# ## Endpoint can contain namespace and multiple type calls.
+# ##
+# ## Please check http://[graylog-server-ip]:12900/api-browser for full list
+# ## of endpoints
+# servers = [
+# "http://[graylog-server-ip]:12900/system/metrics/multiple",
+# ]
+#
+# ## Metrics list
+# ## List of metrics can be found on Graylog webservice documentation.
+# ## Or by hitting the the web service api at:
+# ## http://[graylog-host]:12900/system/metrics
+# metrics = [
+# "jvm.cl.loaded",
+# "jvm.memory.pools.Metaspace.committed"
+# ]
+#
+# ## Username and password
+# username = ""
+# password = ""
+#
+# ## Optional SSL Config
+# # ssl_ca = "/etc/telegraf/ca.pem"
+# # ssl_cert = "/etc/telegraf/cert.pem"
+# # ssl_key = "/etc/telegraf/key.pem"
+# ## Use SSL but skip chain & host verification
+# # insecure_skip_verify = false
+
+
+# # Read metrics of haproxy, via socket or csv stats page
+# [[inputs.haproxy]]
+# ## An array of address to gather stats about. Specify an ip on hostname
+# ## with optional port. ie localhost, 10.10.3.33:1936, etc.
+# ## Make sure you specify the complete path to the stats endpoint
+# ## ie 10.10.3.33:1936/haproxy?stats
+# #
+# ## If no servers are specified, then default to 127.0.0.1:1936/haproxy?stats
+# servers = ["http://myhaproxy.com:1936/haproxy?stats"]
+# ## Or you can also use local socket
+# ## servers = ["socket:/run/haproxy/admin.sock"]
+
+
+# # HTTP/HTTPS request given an address a method and a timeout
+# [[inputs.http_response]]
+# ## Server address (default http://localhost)
+# address = "http://github.com"
+# ## Set response_timeout (default 5 seconds)
+# response_timeout = "5s"
+# ## HTTP Request Method
+# method = "GET"
+# ## Whether to follow redirects from the server (defaults to false)
+# follow_redirects = true
+# ## HTTP Request Headers (all values must be strings)
+# # [inputs.http_response.headers]
+# # Host = "github.com"
+# ## Optional HTTP Request Body
+# # body = '''
+# # {'fake':'data'}
+# # '''
+#
+# ## Optional SSL Config
+# # ssl_ca = "/etc/telegraf/ca.pem"
+# # ssl_cert = "/etc/telegraf/cert.pem"
+# # ssl_key = "/etc/telegraf/key.pem"
+# ## Use SSL but skip chain & host verification
+# # insecure_skip_verify = false
+
+
+# # Read flattened metrics from one or more JSON HTTP endpoints
+# [[inputs.httpjson]]
+# ## NOTE This plugin only reads numerical measurements, strings and booleans
+# ## will be ignored.
+#
+# ## a name for the service being polled
+# name = "webserver_stats"
+#
+# ## URL of each server in the service's cluster
+# servers = [
+# "http://localhost:9999/stats/",
+# "http://localhost:9998/stats/",
+# ]
+#
+# ## HTTP method to use: GET or POST (case-sensitive)
+# method = "GET"
+#
+# ## List of tag names to extract from top-level of JSON server response
+# # tag_keys = [
+# # "my_tag_1",
+# # "my_tag_2"
+# # ]
+#
+# ## HTTP parameters (all values must be strings)
+# [inputs.httpjson.parameters]
+# event_type = "cpu_spike"
+# threshold = "0.75"
+#
+# ## HTTP Header parameters (all values must be strings)
+# # [inputs.httpjson.headers]
+# # X-Auth-Token = "my-xauth-token"
+# # apiVersion = "v1"
+#
+# ## Optional SSL Config
+# # ssl_ca = "/etc/telegraf/ca.pem"
+# # ssl_cert = "/etc/telegraf/cert.pem"
+# # ssl_key = "/etc/telegraf/key.pem"
+# ## Use SSL but skip chain & host verification
+# # insecure_skip_verify = false
+
+
+# # Read InfluxDB-formatted JSON metrics from one or more HTTP endpoints
+# [[inputs.influxdb]]
+# ## Works with InfluxDB debug endpoints out of the box,
+# ## but other services can use this format too.
+# ## See the influxdb plugin's README for more details.
+#
+# ## Multiple URLs from which to read InfluxDB-formatted JSON
+# ## Default is "http://localhost:8086/debug/vars".
+# urls = [
+# "http://localhost:8086/debug/vars"
+# ]
+
+
+# # Read metrics from one or many bare metal servers
+# [[inputs.ipmi_sensor]]
+# ## specify servers via a url matching:
+# ## [username[:password]@][protocol[(address)]]
+# ## e.g.
+# ## root:passwd@lan(127.0.0.1)
+# ##
+# servers = ["USERID:PASSW0RD@lan(192.168.1.1)"]
+
+
+# # Read JMX metrics through Jolokia
+# [[inputs.jolokia]]
+# ## This is the context root used to compose the jolokia url
+# context = "/jolokia"
+#
+# ## This specifies the mode used
+# # mode = "proxy"
+# #
+# ## When in proxy mode this section is used to specify further
+# ## proxy address configurations.
+# ## Remember to change host address to fit your environment.
+# # [inputs.jolokia.proxy]
+# # host = "127.0.0.1"
+# # port = "8080"
+#
+#
+# ## List of servers exposing jolokia read service
+# [[inputs.jolokia.servers]]
+# name = "as-server-01"
+# host = "127.0.0.1"
+# port = "8080"
+# # username = "myuser"
+# # password = "mypassword"
+#
+# ## List of metrics collected on above servers
+# ## Each metric consists in a name, a jmx path and either
+# ## a pass or drop slice attribute.
+# ## This collect all heap memory usage metrics.
+# [[inputs.jolokia.metrics]]
+# name = "heap_memory_usage"
+# mbean = "java.lang:type=Memory"
+# attribute = "HeapMemoryUsage"
+#
+# ## This collect thread counts metrics.
+# [[inputs.jolokia.metrics]]
+# name = "thread_count"
+# mbean = "java.lang:type=Threading"
+# attribute = "TotalStartedThreadCount,ThreadCount,DaemonThreadCount,PeakThreadCount"
+#
+# ## This collect number of class loaded/unloaded counts metrics.
+# [[inputs.jolokia.metrics]]
+# name = "class_count"
+# mbean = "java.lang:type=ClassLoading"
+# attribute = "LoadedClassCount,UnloadedClassCount,TotalLoadedClassCount"
+
+
+# # Read metrics from a LeoFS Server via SNMP
+# [[inputs.leofs]]
+# ## An array of URI to gather stats about LeoFS.
+# ## Specify an ip or hostname with port. ie 127.0.0.1:4020
+# servers = ["127.0.0.1:4021"]
+
+
+# # Read metrics from local Lustre service on OST, MDS
+# [[inputs.lustre2]]
+# ## An array of /proc globs to search for Lustre stats
+# ## If not specified, the default will work on Lustre 2.5.x
+# ##
+# # ost_procfiles = [
+# # "/proc/fs/lustre/obdfilter/*/stats",
+# # "/proc/fs/lustre/osd-ldiskfs/*/stats",
+# # "/proc/fs/lustre/obdfilter/*/job_stats",
+# # ]
+# # mds_procfiles = [
+# # "/proc/fs/lustre/mdt/*/md_stats",
+# # "/proc/fs/lustre/mdt/*/job_stats",
+# # ]
+
+
+# # Gathers metrics from the /3.0/reports MailChimp API
+# [[inputs.mailchimp]]
+# ## MailChimp API key
+# ## get from https://admin.mailchimp.com/account/api/
+# api_key = "" # required
+# ## Reports for campaigns sent more than days_old ago will not be collected.
+# ## 0 means collect all.
+# days_old = 0
+# ## Campaign ID to get, if empty gets all campaigns, this option overrides days_old
+# # campaign_id = ""
+
+
+# # Read metrics from one or many memcached servers
+# [[inputs.memcached]]
+# ## An array of address to gather stats about. Specify an ip on hostname
+# ## with optional port. ie localhost, 10.0.0.1:11211, etc.
+# servers = ["localhost:11211"]
+# # unix_sockets = ["/var/run/memcached.sock"]
+
+
+# # Telegraf plugin for gathering metrics from N Mesos masters
+# [[inputs.mesos]]
+# ## Timeout, in ms.
+# timeout = 100
+# ## A list of Mesos masters.
+# masters = ["localhost:5050"]
+# ## Master metrics groups to be collected, by default, all enabled.
+# master_collections = [
+# "resources",
+# "master",
+# "system",
+# "agents",
+# "frameworks",
+# "tasks",
+# "messages",
+# "evqueue",
+# "registrar",
+# ]
+# ## A list of Mesos slaves, default is []
+# # slaves = []
+# ## Slave metrics groups to be collected, by default, all enabled.
+# # slave_collections = [
+# # "resources",
+# # "agent",
+# # "system",
+# # "executors",
+# # "tasks",
+# # "messages",
+# # ]
+# ## Include mesos tasks statistics, default is false
+# # slave_tasks = true
+
+
+# # Read metrics from one or many MongoDB servers
+# [[inputs.mongodb]]
+# ## An array of URI to gather stats about. Specify an ip or hostname
+# ## with optional port add password. ie,
+# ## mongodb://user:auth_key@10.10.3.30:27017,
+# ## mongodb://10.10.3.33:18832,
+# ## 10.0.0.1:10000, etc.
+# servers = ["127.0.0.1:27017"]
+# gather_perdb_stats = false
+
+
+# # Read metrics from one or many mysql servers
+# [[inputs.mysql]]
+# ## specify servers via a url matching:
+# ## [username[:password]@][protocol[(address)]]/[?tls=[true|false|skip-verify]]
+# ## see https://github.com/go-sql-driver/mysql#dsn-data-source-name
+# ## e.g.
+# ## db_user:passwd@tcp(127.0.0.1:3306)/?tls=false
+# ## db_user@tcp(127.0.0.1:3306)/?tls=false
+# #
+# ## If no servers are specified, then localhost is used as the host.
+# servers = ["tcp(127.0.0.1:3306)/"]
+# ## the limits for metrics form perf_events_statements
+# perf_events_statements_digest_text_limit = 120
+# perf_events_statements_limit = 250
+# perf_events_statements_time_limit = 86400
+# #
+# ## if the list is empty, then metrics are gathered from all databasee tables
+# table_schema_databases = []
+# #
+# ## gather metrics from INFORMATION_SCHEMA.TABLES for databases provided above list
+# gather_table_schema = false
+# #
+# ## gather thread state counts from INFORMATION_SCHEMA.PROCESSLIST
+# gather_process_list = true
+# #
+# ## gather auto_increment columns and max values from information schema
+# gather_info_schema_auto_inc = true
+# #
+# ## gather metrics from SHOW SLAVE STATUS command output
+# gather_slave_status = true
+# #
+# ## gather metrics from SHOW BINARY LOGS command output
+# gather_binary_logs = false
+# #
+# ## gather metrics from PERFORMANCE_SCHEMA.TABLE_IO_WAITS_SUMMART_BY_TABLE
+# gather_table_io_waits = false
+# #
+# ## gather metrics from PERFORMANCE_SCHEMA.TABLE_LOCK_WAITS
+# gather_table_lock_waits = false
+# #
+# ## gather metrics from PERFORMANCE_SCHEMA.TABLE_IO_WAITS_SUMMART_BY_INDEX_USAGE
+# gather_index_io_waits = false
+# #
+# ## gather metrics from PERFORMANCE_SCHEMA.EVENT_WAITS
+# gather_event_waits = false
+# #
+# ## gather metrics from PERFORMANCE_SCHEMA.FILE_SUMMARY_BY_EVENT_NAME
+# gather_file_events_stats = false
+# #
+# ## gather metrics from PERFORMANCE_SCHEMA.EVENTS_STATEMENTS_SUMMARY_BY_DIGEST
+# gather_perf_events_statements = false
+# #
+# ## Some queries we may want to run less often (such as SHOW GLOBAL VARIABLES)
+# interval_slow = "30m"
+
+
+# # Read metrics about network interface usage
+# [[inputs.net]]
+# ## By default, telegraf gathers stats from any up interface (excluding loopback)
+# ## Setting interfaces will tell it to gather these explicit interfaces,
+# ## regardless of status.
+# ##
+# # interfaces = ["eth0"]
+
+
+# # TCP or UDP 'ping' given url and collect response time in seconds
+# [[inputs.net_response]]
+# ## Protocol, must be "tcp" or "udp"
+# protocol = "tcp"
+# ## Server address (default localhost)
+# address = "github.com:80"
+# ## Set timeout
+# timeout = "1s"
+#
+# ## Optional string sent to the server
+# # send = "ssh"
+# ## Optional expected string in answer
+# # expect = "ssh"
+# ## Set read timeout (only used if expecting a response)
+# read_timeout = "1s"
+
+
+# # Read TCP metrics such as established, time wait and sockets counts.
+# [[inputs.netstat]]
+# # no configuration
+
+
+# # Read Nginx's basic status information (ngx_http_stub_status_module)
+# [[inputs.nginx]]
+# ## An array of Nginx stub_status URI to gather stats.
+# urls = ["http://localhost/status"]
+
+
+# # Read NSQ topic and channel statistics.
+# [[inputs.nsq]]
+# ## An array of NSQD HTTP API endpoints
+# endpoints = ["http://localhost:4151"]
+
+
+# # Collect kernel snmp counters and network interface statistics
+# [[inputs.nstat]]
+# ## file paths for proc files. If empty default paths will be used:
+# ## /proc/net/netstat, /proc/net/snmp, /proc/net/snmp6
+# ## These can also be overridden with env variables, see README.
+# proc_net_netstat = "/proc/net/netstat"
+# proc_net_snmp = "/proc/net/snmp"
+# proc_net_snmp6 = "/proc/net/snmp6"
+# ## dump metrics with 0 values too
+# dump_zeros = true
+
+
+# # Get standard NTP query metrics, requires ntpq executable.
+# [[inputs.ntpq]]
+# ## If false, set the -n ntpq flag. Can reduce metric gather time.
+# dns_lookup = true
+
+
+# # Read metrics of passenger using passenger-status
+# [[inputs.passenger]]
+# ## Path of passenger-status.
+# ##
+# ## Plugin gather metric via parsing XML output of passenger-status
+# ## More information about the tool:
+# ## https://www.phusionpassenger.com/library/admin/apache/overall_status_report.html
+# ##
+# ## If no path is specified, then the plugin simply execute passenger-status
+# ## hopefully it can be found in your PATH
+# command = "passenger-status -v --show=xml"
+
+
+# # Read metrics of phpfpm, via HTTP status page or socket
+# [[inputs.phpfpm]]
+# ## An array of addresses to gather stats about. Specify an ip or hostname
+# ## with optional port and path
+# ##
+# ## Plugin can be configured in three modes (either can be used):
+# ## - http: the URL must start with http:// or https://, ie:
+# ## "http://localhost/status"
+# ## "http://192.168.130.1/status?full"
+# ##
+# ## - unixsocket: path to fpm socket, ie:
+# ## "/var/run/php5-fpm.sock"
+# ## or using a custom fpm status path:
+# ## "/var/run/php5-fpm.sock:fpm-custom-status-path"
+# ##
+# ## - fcgi: the URL must start with fcgi:// or cgi://, and port must be present, ie:
+# ## "fcgi://10.0.0.12:9000/status"
+# ## "cgi://10.0.10.12:9001/status"
+# ##
+# ## Example of multiple gathering from local socket and remove host
+# ## urls = ["http://192.168.1.20/status", "/tmp/fpm.sock"]
+# urls = ["http://localhost/status"]
+
+
+# # Ping given url(s) and return statistics
+# [[inputs.ping]]
+# ## NOTE: this plugin forks the ping command. You may need to set capabilities
+# ## via setcap cap_net_raw+p /bin/ping
+# #
+# ## urls to ping
+# urls = ["www.google.com"] # required
+# ## number of pings to send per collection (ping -c )
+# count = 1 # required
+# ## interval, in s, at which to ping. 0 == default (ping -i )
+# ping_interval = 0.0
+# ## per-ping timeout, in s. 0 == no timeout (ping -W )
+# timeout = 1.0
+# ## interface to send ping from (ping -I )
+# interface = ""
+
+
+# # Read metrics from one or many postgresql servers
+# [[inputs.postgresql]]
+# ## specify address via a url matching:
+# ## postgres://[pqgotest[:password]]@localhost[/dbname]\
+# ## ?sslmode=[disable|verify-ca|verify-full]
+# ## or a simple string:
+# ## host=localhost user=pqotest password=... sslmode=... dbname=app_production
+# ##
+# ## All connection parameters are optional.
+# ##
+# ## Without the dbname parameter, the driver will default to a database
+# ## with the same name as the user. This dbname is just for instantiating a
+# ## connection with the server and doesn't restrict the databases we are trying
+# ## to grab metrics for.
+# ##
+# address = "host=localhost user=postgres sslmode=disable"
+#
+# ## A list of databases to pull metrics about. If not specified, metrics for all
+# ## databases are gathered.
+# # databases = ["app_production", "testing"]
+
+
+# # Read metrics from one or many postgresql servers
+# [[inputs.postgresql_extensible]]
+# ## specify address via a url matching:
+# ## postgres://[pqgotest[:password]]@localhost[/dbname]\
+# ## ?sslmode=[disable|verify-ca|verify-full]
+# ## or a simple string:
+# ## host=localhost user=pqotest password=... sslmode=... dbname=app_production
+# #
+# ## All connection parameters are optional. #
+# ## Without the dbname parameter, the driver will default to a database
+# ## with the same name as the user. This dbname is just for instantiating a
+# ## connection with the server and doesn't restrict the databases we are trying
+# ## to grab metrics for.
+# #
+# address = "host=localhost user=postgres sslmode=disable"
+# ## A list of databases to pull metrics about. If not specified, metrics for all
+# ## databases are gathered.
+# ## databases = ["app_production", "testing"]
+# #
+# # outputaddress = "db01"
+# ## A custom name for the database that will be used as the "server" tag in the
+# ## measurement output. If not specified, a default one generated from
+# ## the connection address is used.
+# #
+# ## Define the toml config where the sql queries are stored
+# ## New queries can be added, if the withdbname is set to true and there is no
+# ## databases defined in the 'databases field', the sql query is ended by a
+# ## 'is not null' in order to make the query succeed.
+# ## Example :
+# ## The sqlquery : "SELECT * FROM pg_stat_database where datname" become
+# ## "SELECT * FROM pg_stat_database where datname IN ('postgres', 'pgbench')"
+# ## because the databases variable was set to ['postgres', 'pgbench' ] and the
+# ## withdbname was true. Be careful that if the withdbname is set to false you
+# ## don't have to define the where clause (aka with the dbname) the tagvalue
+# ## field is used to define custom tags (separated by commas)
+# ## The optional "measurement" value can be used to override the default
+# ## output measurement name ("postgresql").
+# #
+# ## Structure :
+# ## [[inputs.postgresql_extensible.query]]
+# ## sqlquery string
+# ## version string
+# ## withdbname boolean
+# ## tagvalue string (comma separated)
+# ## measurement string
+# [[inputs.postgresql_extensible.query]]
+# sqlquery="SELECT * FROM pg_stat_database"
+# version=901
+# withdbname=false
+# tagvalue=""
+# measurement=""
+# [[inputs.postgresql_extensible.query]]
+# sqlquery="SELECT * FROM pg_stat_bgwriter"
+# version=901
+# withdbname=false
+# tagvalue="postgresql.stats"
+
+
+# # Read metrics from one or many PowerDNS servers
+# [[inputs.powerdns]]
+# ## An array of sockets to gather stats about.
+# ## Specify a path to unix socket.
+# unix_sockets = ["/var/run/pdns.controlsocket"]
+
+
+# # Monitor process cpu and memory usage
+# [[inputs.procstat]]
+# ## Must specify one of: pid_file, exe, or pattern
+# ## PID file to monitor process
+# pid_file = "/var/run/nginx.pid"
+# ## executable name (ie, pgrep )
+# # exe = "nginx"
+# ## pattern as argument for pgrep (ie, pgrep -f )
+# # pattern = "nginx"
+# ## user as argument for pgrep (ie, pgrep -u )
+# # user = "nginx"
+#
+# ## override for process_name
+# ## This is optional; default is sourced from /proc//status
+# # process_name = "bar"
+# ## Field name prefix
+# prefix = ""
+# ## comment this out if you want raw cpu_time stats
+# fielddrop = ["cpu_time_*"]
+
+
+# # Read metrics from one or many prometheus clients
+# [[inputs.prometheus]]
+# ## An array of urls to scrape metrics from.
+# urls = ["http://localhost:9100/metrics"]
+#
+# ## Use bearer token for authorization
+# # bearer_token = /path/to/bearer/token
+#
+# ## Optional SSL Config
+# # ssl_ca = /path/to/cafile
+# # ssl_cert = /path/to/certfile
+# # ssl_key = /path/to/keyfile
+# ## Use SSL but skip chain & host verification
+# # insecure_skip_verify = false
+
+
+# # Reads last_run_summary.yaml file and converts to measurments
+# [[inputs.puppetagent]]
+# ## Location of puppet last run summary file
+# location = "/var/lib/puppet/state/last_run_summary.yaml"
+
+
+# # Read metrics from one or many RabbitMQ servers via the management API
+# [[inputs.rabbitmq]]
+# # url = "http://localhost:15672"
+# # name = "rmq-server-1" # optional tag
+# # username = "guest"
+# # password = "guest"
+#
+# ## Optional SSL Config
+# # ssl_ca = "/etc/telegraf/ca.pem"
+# # ssl_cert = "/etc/telegraf/cert.pem"
+# # ssl_key = "/etc/telegraf/key.pem"
+# ## Use SSL but skip chain & host verification
+# # insecure_skip_verify = false
+#
+# ## A list of nodes to pull metrics about. If not specified, metrics for
+# ## all nodes are gathered.
+# # nodes = ["rabbit@node1", "rabbit@node2"]
+
+
+# # Read raindrops stats (raindrops - real-time stats for preforking Rack servers)
+# [[inputs.raindrops]]
+# ## An array of raindrops middleware URI to gather stats.
+# urls = ["http://localhost:8080/_raindrops"]
+
+
+# # Read metrics from one or many redis servers
+# [[inputs.redis]]
+# ## specify servers via a url matching:
+# ## [protocol://][:password]@address[:port]
+# ## e.g.
+# ## tcp://localhost:6379
+# ## tcp://:password@192.168.99.100
+# ## unix:///var/run/redis.sock
+# ##
+# ## If no servers are specified, then localhost is used as the host.
+# ## If no port is specified, 6379 is used
+# servers = ["tcp://localhost:6379"]
+
+
+# # Read metrics from one or many RethinkDB servers
+# [[inputs.rethinkdb]]
+# ## An array of URI to gather stats about. Specify an ip or hostname
+# ## with optional port add password. ie,
+# ## rethinkdb://user:auth_key@10.10.3.30:28105,
+# ## rethinkdb://10.10.3.33:18832,
+# ## 10.0.0.1:10000, etc.
+# servers = ["127.0.0.1:28015"]
+
+
+# # Read metrics one or many Riak servers
+# [[inputs.riak]]
+# # Specify a list of one or more riak http servers
+# servers = ["http://localhost:8098"]
+
+
+# # Retrieves SNMP values from remote agents
+# [[inputs.snmp]]
+# agents = [ "127.0.0.1:161" ]
+# timeout = "5s"
+# version = 2
+#
+# # SNMPv1 & SNMPv2 parameters
+# community = "public"
+#
+# # SNMPv2 & SNMPv3 parameters
+# max_repetitions = 50
+#
+# # SNMPv3 parameters
+# #sec_name = "myuser"
+# #auth_protocol = "md5" # Values: "MD5", "SHA", ""
+# #auth_password = "password123"
+# #sec_level = "authNoPriv" # Values: "noAuthNoPriv", "authNoPriv", "authPriv"
+# #context_name = ""
+# #priv_protocol = "" # Values: "DES", "AES", ""
+# #priv_password = ""
+#
+# # measurement name
+# name = "system"
+# [[inputs.snmp.field]]
+# name = "hostname"
+# oid = ".1.0.0.1.1"
+# [[inputs.snmp.field]]
+# name = "uptime"
+# oid = ".1.0.0.1.2"
+# [[inputs.snmp.field]]
+# name = "load"
+# oid = ".1.0.0.1.3"
+# [[inputs.snmp.field]]
+# oid = "HOST-RESOURCES-MIB::hrMemorySize"
+#
+# [[inputs.snmp.table]]
+# # measurement name
+# name = "remote_servers"
+# inherit_tags = [ "hostname" ]
+# [[inputs.snmp.table.field]]
+# name = "server"
+# oid = ".1.0.0.0.1.0"
+# is_tag = true
+# [[inputs.snmp.table.field]]
+# name = "connections"
+# oid = ".1.0.0.0.1.1"
+# [[inputs.snmp.table.field]]
+# name = "latency"
+# oid = ".1.0.0.0.1.2"
+#
+# [[inputs.snmp.table]]
+# # auto populate table's fields using the MIB
+# oid = "HOST-RESOURCES-MIB::hrNetworkTable"
+
+
+# # DEPRECATED! PLEASE USE inputs.snmp INSTEAD.
+# [[inputs.snmp_legacy]]
+# ## Use 'oids.txt' file to translate oids to names
+# ## To generate 'oids.txt' you need to run:
+# ## snmptranslate -m all -Tz -On | sed -e 's/"//g' > /tmp/oids.txt
+# ## Or if you have an other MIB folder with custom MIBs
+# ## snmptranslate -M /mycustommibfolder -Tz -On -m all | sed -e 's/"//g' > oids.txt
+# snmptranslate_file = "/tmp/oids.txt"
+# [[inputs.snmp.host]]
+# address = "192.168.2.2:161"
+# # SNMP community
+# community = "public" # default public
+# # SNMP version (1, 2 or 3)
+# # Version 3 not supported yet
+# version = 2 # default 2
+# # SNMP response timeout
+# timeout = 2.0 # default 2.0
+# # SNMP request retries
+# retries = 2 # default 2
+# # Which get/bulk do you want to collect for this host
+# collect = ["mybulk", "sysservices", "sysdescr"]
+# # Simple list of OIDs to get, in addition to "collect"
+# get_oids = []
+#
+# [[inputs.snmp.host]]
+# address = "192.168.2.3:161"
+# community = "public"
+# version = 2
+# timeout = 2.0
+# retries = 2
+# collect = ["mybulk"]
+# get_oids = [
+# "ifNumber",
+# ".1.3.6.1.2.1.1.3.0",
+# ]
+#
+# [[inputs.snmp.get]]
+# name = "ifnumber"
+# oid = "ifNumber"
+#
+# [[inputs.snmp.get]]
+# name = "interface_speed"
+# oid = "ifSpeed"
+# instance = "0"
+#
+# [[inputs.snmp.get]]
+# name = "sysuptime"
+# oid = ".1.3.6.1.2.1.1.3.0"
+# unit = "second"
+#
+# [[inputs.snmp.bulk]]
+# name = "mybulk"
+# max_repetition = 127
+# oid = ".1.3.6.1.2.1.1"
+#
+# [[inputs.snmp.bulk]]
+# name = "ifoutoctets"
+# max_repetition = 127
+# oid = "ifOutOctets"
+#
+# [[inputs.snmp.host]]
+# address = "192.168.2.13:161"
+# #address = "127.0.0.1:161"
+# community = "public"
+# version = 2
+# timeout = 2.0
+# retries = 2
+# #collect = ["mybulk", "sysservices", "sysdescr", "systype"]
+# collect = ["sysuptime" ]
+# [[inputs.snmp.host.table]]
+# name = "iftable3"
+# include_instances = ["enp5s0", "eth1"]
+#
+# # SNMP TABLEs
+# # table without mapping neither subtables
+# [[inputs.snmp.table]]
+# name = "iftable1"
+# oid = ".1.3.6.1.2.1.31.1.1.1"
+#
+# # table without mapping but with subtables
+# [[inputs.snmp.table]]
+# name = "iftable2"
+# oid = ".1.3.6.1.2.1.31.1.1.1"
+# sub_tables = [".1.3.6.1.2.1.2.2.1.13"]
+#
+# # table with mapping but without subtables
+# [[inputs.snmp.table]]
+# name = "iftable3"
+# oid = ".1.3.6.1.2.1.31.1.1.1"
+# # if empty. get all instances
+# mapping_table = ".1.3.6.1.2.1.31.1.1.1.1"
+# # if empty, get all subtables
+#
+# # table with both mapping and subtables
+# [[inputs.snmp.table]]
+# name = "iftable4"
+# oid = ".1.3.6.1.2.1.31.1.1.1"
+# # if empty get all instances
+# mapping_table = ".1.3.6.1.2.1.31.1.1.1.1"
+# # if empty get all subtables
+# # sub_tables could be not "real subtables"
+# sub_tables=[".1.3.6.1.2.1.2.2.1.13", "bytes_recv", "bytes_send"]
+
+
+# # Read metrics from Microsoft SQL Server
+# [[inputs.sqlserver]]
+# ## Specify instances to monitor with a list of connection strings.
+# ## All connection parameters are optional.
+# ## By default, the host is localhost, listening on default port, TCP 1433.
+# ## for Windows, the user is the currently running AD user (SSO).
+# ## See https://github.com/denisenkom/go-mssqldb for detailed connection
+# ## parameters.
+# # servers = [
+# # "Server=192.168.1.10;Port=1433;User Id=;Password=;app name=telegraf;log=1;",
+# # ]
+
+
+# # Inserts sine and cosine waves for demonstration purposes
+# [[inputs.trig]]
+# ## Set the amplitude
+# amplitude = 10.0
+
+
+# # Read Twemproxy stats data
+# [[inputs.twemproxy]]
+# ## Twemproxy stats address and port (no scheme)
+# addr = "localhost:22222"
+# ## Monitor pool name
+# pools = ["redis_pool", "mc_pool"]
+
+
+# # A plugin to collect stats from Varnish HTTP Cache
+# [[inputs.varnish]]
+# ## The default location of the varnishstat binary can be overridden with:
+# binary = "/usr/bin/varnishstat"
+#
+# ## By default, telegraf gather stats for 3 metric points.
+# ## Setting stats will override the defaults shown below.
+# ## Glob matching can be used, ie, stats = ["MAIN.*"]
+# ## stats may also be set to ["*"], which will collect all stats
+# stats = ["MAIN.cache_hit", "MAIN.cache_miss", "MAIN.uptime"]
+
+
+# # Read metrics of ZFS from arcstats, zfetchstats, vdev_cache_stats, and pools
+# [[inputs.zfs]]
+# ## ZFS kstat path. Ignored on FreeBSD
+# ## If not specified, then default is:
+# # kstatPath = "/proc/spl/kstat/zfs"
+#
+# ## By default, telegraf gather all zfs stats
+# ## If not specified, then default is:
+# # kstatMetrics = ["arcstats", "zfetchstats", "vdev_cache_stats"]
+#
+# ## By default, don't gather zpool stats
+# # poolMetrics = false
+
+
+# # Reads 'mntr' stats from one or many zookeeper servers
+# [[inputs.zookeeper]]
+# ## An array of address to gather stats about. Specify an ip or hostname
+# ## with port. ie localhost:2181, 10.0.0.1:2181, etc.
+#
+# ## If no servers are specified, then localhost is used as the host.
+# ## If no port is specified, 2181 is used
+# servers = [":2181"]
+
+
+
+###############################################################################
+# SERVICE INPUT PLUGINS #
+###############################################################################
+
+# # Read metrics from Kafka topic(s)
+# [[inputs.kafka_consumer]]
+# ## topic(s) to consume
+# topics = ["telegraf"]
+# ## an array of Zookeeper connection strings
+# zookeeper_peers = ["localhost:2181"]
+# ## Zookeeper Chroot
+# zookeeper_chroot = ""
+# ## the name of the consumer group
+# consumer_group = "telegraf_metrics_consumers"
+# ## Offset (must be either "oldest" or "newest")
+# offset = "oldest"
+#
+# ## Data format to consume.
+# ## Each data format has it's own unique set of configuration options, read
+# ## more about them here:
+# ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
+# data_format = "influx"
+
+
+# # Stream and parse log file(s).
+# [[inputs.logparser]]
+# ## Log files to parse.
+# ## These accept standard unix glob matching rules, but with the addition of
+# ## ** as a "super asterisk". ie:
+# ## /var/log/**.log -> recursively find all .log files in /var/log
+# ## /var/log/*/*.log -> find all .log files with a parent dir in /var/log
+# ## /var/log/apache.log -> only tail the apache log file
+# files = ["/var/log/apache/access.log"]
+# ## Read file from beginning.
+# from_beginning = false
+#
+# ## Parse logstash-style "grok" patterns:
+# ## Telegraf built-in parsing patterns: https://goo.gl/dkay10
+# [inputs.logparser.grok]
+# ## This is a list of patterns to check the given log file(s) for.
+# ## Note that adding patterns here increases processing time. The most
+# ## efficient configuration is to have one pattern per logparser.
+# ## Other common built-in patterns are:
+# ## %{COMMON_LOG_FORMAT} (plain apache & nginx access logs)
+# ## %{COMBINED_LOG_FORMAT} (access logs + referrer & agent)
+# patterns = ["%{COMBINED_LOG_FORMAT}"]
+# ## Name of the outputted measurement name.
+# measurement = "apache_access_log"
+# ## Full path(s) to custom pattern files.
+# custom_pattern_files = []
+# ## Custom patterns can also be defined here. Put one pattern per line.
+# custom_patterns = '''
+# '''
+
+
+# # Read metrics from MQTT topic(s)
+# [[inputs.mqtt_consumer]]
+# servers = ["localhost:1883"]
+# ## MQTT QoS, must be 0, 1, or 2
+# qos = 0
+#
+# ## Topics to subscribe to
+# topics = [
+# "telegraf/host01/cpu",
+# "telegraf/+/mem",
+# "sensors/#",
+# ]
+#
+# # if true, messages that can't be delivered while the subscriber is offline
+# # will be delivered when it comes back (such as on service restart).
+# # NOTE: if true, client_id MUST be set
+# persistent_session = false
+# # If empty, a random client ID will be generated.
+# client_id = ""
+#
+# ## username and password to connect MQTT server.
+# # username = "telegraf"
+# # password = "metricsmetricsmetricsmetrics"
+#
+# ## Optional SSL Config
+# # ssl_ca = "/etc/telegraf/ca.pem"
+# # ssl_cert = "/etc/telegraf/cert.pem"
+# # ssl_key = "/etc/telegraf/key.pem"
+# ## Use SSL but skip chain & host verification
+# # insecure_skip_verify = false
+#
+# ## Data format to consume.
+# ## Each data format has it's own unique set of configuration options, read
+# ## more about them here:
+# ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
+# data_format = "influx"
+
+
+# # Read metrics from NATS subject(s)
+# [[inputs.nats_consumer]]
+# ## urls of NATS servers
+# servers = ["nats://localhost:4222"]
+# ## Use Transport Layer Security
+# secure = false
+# ## subject(s) to consume
+# subjects = ["telegraf"]
+# ## name a queue group
+# queue_group = "telegraf_consumers"
+#
+# ## Data format to consume.
+# ## Each data format has it's own unique set of configuration options, read
+# ## more about them here:
+# ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
+# data_format = "influx"
+
+
+# # Read NSQ topic for metrics.
+# [[inputs.nsq_consumer]]
+# ## An string representing the NSQD TCP Endpoint
+# server = "localhost:4150"
+# topic = "telegraf"
+# channel = "consumer"
+# max_in_flight = 100
+#
+# ## Data format to consume.
+# ## Each data format has it's own unique set of configuration options, read
+# ## more about them here:
+# ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
+# data_format = "influx"
+
+
+# # Statsd Server
+# [[inputs.statsd]]
+# ## Address and port to host UDP listener on
+# service_address = ":8125"
+# ## Delete gauges every interval (default=false)
+# delete_gauges = false
+# ## Delete counters every interval (default=false)
+# delete_counters = false
+# ## Delete sets every interval (default=false)
+# delete_sets = false
+# ## Delete timings & histograms every interval (default=true)
+# delete_timings = true
+# ## Percentiles to calculate for timing & histogram stats
+# percentiles = [90]
+#
+# ## separator to use between elements of a statsd metric
+# metric_separator = "_"
+#
+# ## Parses tags in the datadog statsd format
+# ## http://docs.datadoghq.com/guides/dogstatsd/
+# parse_data_dog_tags = false
+#
+# ## Statsd data translation templates, more info can be read here:
+# ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md#graphite
+# # templates = [
+# # "cpu.* measurement*"
+# # ]
+#
+# ## Number of UDP messages allowed to queue up, once filled,
+# ## the statsd server will start dropping packets
+# allowed_pending_messages = 10000
+#
+# ## Number of timing/histogram values to track per-measurement in the
+# ## calculation of percentiles. Raising this limit increases the accuracy
+# ## of percentiles but also increases the memory usage and cpu time.
+# percentile_limit = 1000
+
+
+# # Stream a log file, like the tail -f command
+# [[inputs.tail]]
+# ## files to tail.
+# ## These accept standard unix glob matching rules, but with the addition of
+# ## ** as a "super asterisk". ie:
+# ## "/var/log/**.log" -> recursively find all .log files in /var/log
+# ## "/var/log/*/*.log" -> find all .log files with a parent dir in /var/log
+# ## "/var/log/apache.log" -> just tail the apache log file
+# ##
+# ## See https://github.com/gobwas/glob for more examples
+# ##
+# files = ["/var/mymetrics.out"]
+# ## Read file from beginning.
+# from_beginning = false
+#
+# ## Data format to consume.
+# ## Each data format has it's own unique set of configuration options, read
+# ## more about them here:
+# ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
+# data_format = "influx"
+
+
+# # Generic TCP listener
+# [[inputs.tcp_listener]]
+# ## Address and port to host TCP listener on
+# service_address = ":8094"
+#
+# ## Number of TCP messages allowed to queue up. Once filled, the
+# ## TCP listener will start dropping packets.
+# allowed_pending_messages = 10000
+#
+# ## Maximum number of concurrent TCP connections to allow
+# max_tcp_connections = 250
+#
+# ## Data format to consume.
+# ## Each data format has it's own unique set of configuration options, read
+# ## more about them here:
+# ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
+# data_format = "influx"
+
+
+# # Generic UDP listener
+# [[inputs.udp_listener]]
+# ## Address and port to host UDP listener on
+# service_address = ":8092"
+#
+# ## Number of UDP messages allowed to queue up. Once filled, the
+# ## UDP listener will start dropping packets.
+# allowed_pending_messages = 10000
+#
+# ## Data format to consume.
+# ## Each data format has it's own unique set of configuration options, read
+# ## more about them here:
+# ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
+# data_format = "influx"
+
+
+# # A Webhooks Event collector
+# [[inputs.webhooks]]
+# ## Address and port to host Webhook listener on
+# service_address = ":1619"
+#
+# [inputs.webhooks.github]
+# path = "/github"
+#
+# [inputs.webhooks.mandrill]
+# path = "/mandrill"
+#
+# [inputs.webhooks.rollbar]
+# path = "/rollbar"
+
diff --git a/tutorial/docker-orchestration/misc/telegraf/usr/bin/telegraf b/tutorial/docker-orchestration/misc/telegraf/usr/bin/telegraf
new file mode 100755
index 0000000..d6335f5
Binary files /dev/null and b/tutorial/docker-orchestration/misc/telegraf/usr/bin/telegraf differ
diff --git a/tutorial/docker-orchestration/misc/telegraf/usr/lib/telegraf/scripts/init.sh b/tutorial/docker-orchestration/misc/telegraf/usr/lib/telegraf/scripts/init.sh
new file mode 100644
index 0000000..1994deb
--- /dev/null
+++ b/tutorial/docker-orchestration/misc/telegraf/usr/lib/telegraf/scripts/init.sh
@@ -0,0 +1,208 @@
+#! /usr/bin/env bash
+
+# chkconfig: 2345 99 01
+# description: Telegraf daemon
+
+### BEGIN INIT INFO
+# Provides: telegraf
+# Required-Start: $all
+# Required-Stop: $remote_fs $syslog
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Start telegraf at boot time
+### END INIT INFO
+
+# this init script supports three different variations:
+# 1. New lsb that define start-stop-daemon
+# 2. Old lsb that don't have start-stop-daemon but define, log, pidofproc and killproc
+# 3. Centos installations without lsb-core installed
+#
+# In the third case we have to define our own functions which are very dumb
+# and expect the args to be positioned correctly.
+
+# Command-line options that can be set in /etc/default/telegraf. These will override
+# any config file values.
+TELEGRAF_OPTS=
+
+USER=telegraf
+GROUP=telegraf
+
+if [ -r /lib/lsb/init-functions ]; then
+ source /lib/lsb/init-functions
+fi
+
+DEFAULT=/etc/default/telegraf
+
+if [ -r $DEFAULT ]; then
+ source $DEFAULT
+fi
+
+if [ -z "$STDOUT" ]; then
+ STDOUT=/dev/null
+fi
+if [ ! -f "$STDOUT" ]; then
+ mkdir -p `dirname $STDOUT`
+fi
+
+if [ -z "$STDERR" ]; then
+ STDERR=/var/log/telegraf/telegraf.log
+fi
+if [ ! -f "$STDERR" ]; then
+ mkdir -p `dirname $STDERR`
+fi
+
+OPEN_FILE_LIMIT=65536
+
+function pidofproc() {
+ if [ $# -ne 3 ]; then
+ echo "Expected three arguments, e.g. $0 -p pidfile daemon-name"
+ fi
+
+ if [ ! -f "$2" ]; then
+ return 1
+ fi
+
+ local pidfile=`cat $2`
+
+ if [ "x$pidfile" == "x" ]; then
+ return 1
+ fi
+
+ if ps --pid "$pidfile" | grep -q $(basename $3); then
+ return 0
+ fi
+
+ return 1
+}
+
+function killproc() {
+ if [ $# -ne 3 ]; then
+ echo "Expected three arguments, e.g. $0 -p pidfile signal"
+ fi
+
+ pid=`cat $2`
+
+ kill -s $3 $pid
+}
+
+function log_failure_msg() {
+ echo "$@" "[ FAILED ]"
+}
+
+function log_success_msg() {
+ echo "$@" "[ OK ]"
+}
+
+# Process name ( For display )
+name=telegraf
+
+# Daemon name, where is the actual executable
+daemon=/usr/bin/telegraf
+
+# pid file for the daemon
+pidfile=/var/run/telegraf/telegraf.pid
+piddir=`dirname $pidfile`
+
+if [ ! -d "$piddir" ]; then
+ mkdir -p $piddir
+ chown $USER:$GROUP $piddir
+fi
+
+# Configuration file
+config=/etc/telegraf/telegraf.conf
+confdir=/etc/telegraf/telegraf.d
+
+# If the daemon is not there, then exit.
+[ -x $daemon ] || exit 5
+
+case $1 in
+ start)
+ # Checked the PID file exists and check the actual status of process
+ if [ -e $pidfile ]; then
+ pidofproc -p $pidfile $daemon > /dev/null 2>&1 && status="0" || status="$?"
+ # If the status is SUCCESS then don't need to start again.
+ if [ "x$status" = "x0" ]; then
+ log_failure_msg "$name process is running"
+ exit 0 # Exit
+ fi
+ fi
+
+ # Bump the file limits, before launching the daemon. These will carry over to
+ # launched processes.
+ ulimit -n $OPEN_FILE_LIMIT
+ if [ $? -ne 0 ]; then
+ log_failure_msg "set open file limit to $OPEN_FILE_LIMIT"
+ fi
+
+ log_success_msg "Starting the process" "$name"
+ if which start-stop-daemon > /dev/null 2>&1; then
+ start-stop-daemon --chuid $USER:$GROUP --start --quiet --pidfile $pidfile --exec $daemon -- -pidfile $pidfile -config $config -config-directory $confdir $TELEGRAF_OPTS >>$STDOUT 2>>$STDERR &
+ else
+ su -s /bin/sh -c "nohup $daemon -pidfile $pidfile -config $config -config-directory $confdir $TELEGRAF_OPTS >>$STDOUT 2>>$STDERR &" $USER
+ fi
+ log_success_msg "$name process was started"
+ ;;
+
+ stop)
+ # Stop the daemon.
+ if [ -e $pidfile ]; then
+ pidofproc -p $pidfile $daemon > /dev/null 2>&1 && status="0" || status="$?"
+ if [ "$status" = 0 ]; then
+ if killproc -p $pidfile SIGTERM && /bin/rm -rf $pidfile; then
+ log_success_msg "$name process was stopped"
+ else
+ log_failure_msg "$name failed to stop service"
+ fi
+ fi
+ else
+ log_failure_msg "$name process is not running"
+ fi
+ ;;
+
+ reload)
+ # Reload the daemon.
+ if [ -e $pidfile ]; then
+ pidofproc -p $pidfile $daemon > /dev/null 2>&1 && status="0" || status="$?"
+ if [ "$status" = 0 ]; then
+ if killproc -p $pidfile SIGHUP; then
+ log_success_msg "$name process was reloaded"
+ else
+ log_failure_msg "$name failed to reload service"
+ fi
+ fi
+ else
+ log_failure_msg "$name process is not running"
+ fi
+ ;;
+
+ restart)
+ # Restart the daemon.
+ $0 stop && sleep 2 && $0 start
+ ;;
+
+ status)
+ # Check the status of the process.
+ if [ -e $pidfile ]; then
+ if pidofproc -p $pidfile $daemon > /dev/null; then
+ log_success_msg "$name Process is running"
+ exit 0
+ else
+ log_failure_msg "$name Process is not running"
+ exit 1
+ fi
+ else
+ log_failure_msg "$name Process is not running"
+ exit 3
+ fi
+ ;;
+
+ version)
+ $daemon version
+ ;;
+
+ *)
+ # For invalid arguments, print the usage message.
+ echo "Usage: $0 {start|stop|restart|status|version}"
+ exit 2
+ ;;
+esac
diff --git a/tutorial/docker-orchestration/misc/telegraf/usr/lib/telegraf/scripts/telegraf.service b/tutorial/docker-orchestration/misc/telegraf/usr/lib/telegraf/scripts/telegraf.service
new file mode 100644
index 0000000..81c9b54
--- /dev/null
+++ b/tutorial/docker-orchestration/misc/telegraf/usr/lib/telegraf/scripts/telegraf.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=The plugin-driven server agent for reporting metrics into InfluxDB
+Documentation=https://github.com/influxdata/telegraf
+After=network.target
+
+[Service]
+EnvironmentFile=-/etc/default/telegraf
+User=telegraf
+Environment='STDOUT=/var/log/telegraf/telegraf.log'
+Environment='STDERR=/var/log/telegraf/telegraf.log'
+ExecStart=/bin/sh -c "exec /usr/bin/telegraf -config /etc/telegraf/telegraf.conf -config-directory /etc/telegraf/telegraf.d ${TELEGRAF_OPTS} >>${STDOUT} 2>>${STDERR}"
+ExecReload=/bin/kill -HUP $MAINPID
+Restart=on-failure
+KillMode=control-group
+
+[Install]
+WantedBy=multi-user.target
diff --git a/tutorial/docker-orchestration/stack.md b/tutorial/docker-orchestration/stack.md
index e614a72..143ae90 100644
--- a/tutorial/docker-orchestration/stack.md
+++ b/tutorial/docker-orchestration/stack.md
@@ -27,14 +27,14 @@ un serveur web, qui sera bien plus représentatif de ce que l'on pourra obtenir.
Précédemment, nous lancions notre serveur web favori avec :
```shell
-docker container run --name mywebs -d nginx
+ docker container run --name mywebs -d nginx
```
La même commande, mais déployée à partir d'un nœud manager, vers un nœud
*workers*, est :
```shell
-docker service create --name myWebS nginx
+ docker service create --name myWebS nginx
```
Allons-y, essayons !
@@ -42,9 +42,9 @@ Allons-y, essayons !
On peut consulter l'état du service avec, comme d'habitude `ls` :
```shell
-42sh$ docker service ls
-ID NAME MODE REPLICAS IMAGE PORTS
-iyue3rgd0ohs myWebS replicated 1/1 nginx:latest
+ 42sh$ docker service ls
+ ID NAME MODE REPLICAS IMAGE PORTS
+ iyue3rgd0ohs myWebS replicated 1/1 nginx:latest
```
Vous pouvez constater que sur l'un des nœuds, sur lequel votre serveur aura été
@@ -56,7 +56,7 @@ Rien de très excitant pour le moment, car nous ne pouvons pas vraiment accéder
d'ajouter une redirection de port :
```shell
-docker service update --publish-add 80 myWebS
+ docker service update --publish-add 80 myWebS
```
À chaque modification de configuration, les conteneurs lancés au sein du
@@ -101,13 +101,13 @@ Ce qui se fait souvent avec beaucoup de douleur hors de Docker, se résume ici
:
```shell
-docker service update --replicas 3 myWebS
+ docker service update --replicas 3 myWebS
```
Roulement de tambours .......
```shell
-docker service ps myWebS
+ docker service ps myWebS
```
nous montre bien, a priori 3 tâches en cours d'exécution pour ce service !
@@ -127,7 +127,7 @@ Notre système de monitoring est une *stack* lui aussi, d'ailleurs, nous pouvons
la lancer grâce à notre `docker-compose.yml` :
```shell
-docker stack deploy --compose-file docker-compose.yml tic
+ docker stack deploy --compose-file docker-compose.yml tic
```
### Règle de déploiement
@@ -136,23 +136,23 @@ Par rapport à `docker-compose`, nous pouvons indiquer dans ce fichier des
paramètres qui ne serviront qu'au déploiement de notre tâche.
```yaml
-version: '3'
-services:
- redis:
- image: redis:alpine
+ version: '3'
+ services:
+ redis:
+ image: redis:alpine
- deploy:
- replicas: 6
- update_config:
- parallelism: 2
- delay: 10s
- restart_policy:
- condition: on-failure
- placement:
- constraints:
- - node.role == manager
- resources:
- memory: 50M
+ deploy:
+ replicas: 6
+ update_config:
+ parallelism: 2
+ delay: 10s
+ restart_policy:
+ condition: on-failure
+ placement:
+ constraints:
+ - node.role == manager
+ resources:
+ memory: 50M
```
Certaines informations comme les ressources, permettent à l'orchestrateur de
diff --git a/tutorial/docker-orchestration/swarm.md b/tutorial/docker-orchestration/swarm.md
index 3fbead6..11db8c6 100644
--- a/tutorial/docker-orchestration/swarm.md
+++ b/tutorial/docker-orchestration/swarm.md
@@ -78,7 +78,7 @@ ce n'est pas plus compliqué que de faire :
@@ -129,11 +129,11 @@ Une fois rejoint, vous devriez voir apparaître un nouveau nœud *worker* dans :
```shell
-42sh$ eval $(docker-machine env -u)
-42sh$ docker node ls
-ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS
-y9skzvuf989hjrkciu8mnsy echinoidea Ready Active
-ovgh6r32kgcbswb2we48br1 * wales Ready Active Leader
+ 42sh$ eval $(docker-machine env -u)
+ 42sh$ docker node ls
+ ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS
+ y9skzvuf989hjrkciu8mnsy echinoidea Ready Active
+ ovgh6r32kgcbswb2we48br1 * wales Ready Active Leader
```
diff --git a/tutorial/dockerfiles/dockerfile.md b/tutorial/dockerfiles/dockerfile.md
index f52e2ef..b4471b2 100644
--- a/tutorial/dockerfiles/dockerfile.md
+++ b/tutorial/dockerfiles/dockerfile.md
@@ -12,10 +12,10 @@ que l'on a réussi à faire précédemment en utilisant le `Dockerfile` suivant
```
-FROM ubuntu:latest
+ FROM ubuntu:latest
-RUN apt-get update
-RUN apt-get install -y nano
+ RUN apt-get update
+ RUN apt-get install -y nano
```
diff --git a/tutorial/dockerfiles/entrypoint.md b/tutorial/dockerfiles/entrypoint.md
index e375220..c1e560c 100644
--- a/tutorial/dockerfiles/entrypoint.md
+++ b/tutorial/dockerfiles/entrypoint.md
@@ -13,8 +13,8 @@ Petit indice, les requêtes SQL sont les suivantes :
```
-DELETE FROM "data_source";
-INSERT INTO "data_source" VALUES(1,1,0,'influxdb','influx','direct','http://${}:8086/','user','pass','metrics',0,'','',0,'null','2015-10-29 09:00:00','2015-10-29 09:05:00');
+ DELETE FROM "data_source";
+ INSERT INTO "data_source" VALUES(1,1,0,'influxdb','influx','direct','http://${}:8086/','user','pass','metrics',0,'','',0,'null','2015-10-29 09:00:00','2015-10-29 09:05:00');
```
diff --git a/tutorial/dockerfiles/first.md b/tutorial/dockerfiles/first.md
index a07017f..cbe3a62 100644
--- a/tutorial/dockerfiles/first.md
+++ b/tutorial/dockerfiles/first.md
@@ -102,10 +102,10 @@ votre InfluxDB écoute sur le port 8086 local :
@@ -116,9 +116,9 @@ Dans l'interface sélectionnez la base `telegraf` puis explorez les valeurs :
```sql
-SHOW MEASUREMENTS
-SHOW FIELD KEYS
-SELECT usage_idle FROM cpu WHERE cpu = 'cpu-total' ORDER BY time DESC LIMIT 5
+ SHOW MEASUREMENTS
+ SHOW FIELD KEYS
+ SELECT usage_idle FROM cpu WHERE cpu = 'cpu-total' ORDER BY time DESC LIMIT 5
```
diff --git a/tutorial/dockerfiles/goodpractices.md b/tutorial/dockerfiles/goodpractices.md
index 9b2c196..482a39c 100644
--- a/tutorial/dockerfiles/goodpractices.md
+++ b/tutorial/dockerfiles/goodpractices.md
@@ -56,9 +56,9 @@ Lorsqu'une ligne devient complexe, allez à la ligne :
```shell
-#!/bin/bash
-set -e
+ #!/bin/bash
+ set -e
-if [ "$1" = 'postgres' ]; then
-chown -R postgres "$PGDATA"
+ if [ "$1" = 'postgres' ]; then
+ chown -R postgres "$PGDATA"
-if [ -z "$(ls -A "$PGDATA")" ]; then
- gosu postgres initdb
-fi
+ if [ -z "$(ls -A "$PGDATA")" ]; then
+ gosu postgres initdb
+ fi
-exec gosu postgres "$@"
-fi
+ exec gosu postgres "$@"
+ fi
-exec "$@"
+ exec "$@"
```
diff --git a/tutorial/dockerfiles/interactive.md b/tutorial/dockerfiles/interactive.md
index 8dd9e96..e290485 100644
--- a/tutorial/dockerfiles/interactive.md
+++ b/tutorial/dockerfiles/interactive.md
@@ -7,7 +7,7 @@ Pour créer une image, commençons par entrer dans un nouveau conteneur :
```
-docker container run -it ubuntu /bin/bash
+ docker container run -it ubuntu /bin/bash
```
@@ -20,7 +20,7 @@ pas incluses dans le conteneur.
```
-apt-get update
+ apt-get update
```
@@ -34,7 +34,7 @@ Installons maintenant un programme :
diff --git a/tutorial/dockerfiles/split.md b/tutorial/dockerfiles/split.md
index e6e0e13..93648f9 100644
--- a/tutorial/dockerfiles/split.md
+++ b/tutorial/dockerfiles/split.md
@@ -31,7 +31,7 @@ conteneur influxdb de la première partie est toujours lancé).
```shell
-docker run --rm --link YOUR_INFLUX_CNTR_NAME:influxdb chronograf
+ docker run --rm --link YOUR_INFLUX_CNTR_NAME:influxdb chronograf
```
@@ -52,7 +52,7 @@ suivantes :
```sql
-SELECT used, available, cached FROM mem WHERE tmpltime()
-SELECT mean(usage_idle) FROM cpu WHERE tmpltime() GROUP BY time(20s), cpu
+ SELECT used, available, cached FROM mem WHERE tmpltime()
+ SELECT mean(usage_idle) FROM cpu WHERE tmpltime() GROUP BY time(20s), cpu
```
diff --git a/tutorial/dockerfiles/supervisor.md b/tutorial/dockerfiles/supervisor.md
index 7c75973..f0d6b68 100644
--- a/tutorial/dockerfiles/supervisor.md
+++ b/tutorial/dockerfiles/supervisor.md
@@ -83,9 +83,6 @@ cela. Mais plein de gens ont cette problématique et l'application `supervisor`
répond parfaitement à notre problématique !
-## `HEALTHCHECK`
-
-
## `supervisor`
Première étape : installer `supervisor`, le paquet se trouve dans les dépôts.