瀏覽代碼

added vaping for pinging infrastructure

dirkse 8 年之前
父節點
當前提交
c514131b21
共有 3 個文件被更改,包括 139 次插入12 次删除
  1. 22 12
      services.yml
  2. 19 0
      vaping/Dockerfile
  3. 98 0
      vaping/config.yml

+ 22 - 12
services.yml

@@ -144,6 +144,9 @@ gogs: # git server with wiki
     ports: 3022:22
     env:
       VIRTUAL_PORT: 3000
+    healthcheck:
+      test: curl -I --silent http://localhost:3000 | grep "404 Not Found"
+      interval: 10 # seconds
 
 graphite:
   host: himbeere
@@ -179,27 +182,34 @@ matrix: # interface with RGB LED-Matrix
       - /opt/jupyter/config_ipy_root:/root/.ipython
   commands:
     # some rotating square
-    demo00: examples-api-use/demo -c 4 -L --led-show-refresh -D0
+    demo00: examples-api-use/demo -c 4 --led-show-refresh -D0
     # forward scrolling an image
-    demo01: examples-api-use/demo -c 4 -L --led-show-refresh -D1 examples-api-use/runtext.ppm
+    demo01: examples-api-use/demo -c 4 --led-show-refresh -D1 examples-api-use/runtext.ppm
     # test image
-    demo03: examples-api-use/demo -c 4 -L -D3
+    demo03: examples-api-use/demo -c 4 -D3
     # Abelian sandpile model (-m <time-step-ms>)
-    demo06: examples-api-use/demo -c 4 -L -D6
+    demo06: examples-api-use/demo -c 4 -D6
     # Conway's game of life (-m <time-step-ms>)
-    demo07: /bin/bash -c "while true; do examples-api-use/demo -c 4 -L -b 5 -D7 -t 15; done"
+    demo07: /bin/bash -c "while true; do examples-api-use/demo -c 4 -b 20 -D7 -t 15; done"
     # Langton's ant (-m <time-step-ms>)
-    demo08: examples-api-use/demo -c 4 -L -m 1  --led-show-refresh -D8
+    demo08: examples-api-use/demo -c 4 -m 1  --led-show-refresh -D8
     # Volume bars
-    demo09: examples-api-use/demo -c 4 -L -D9
+    demo09: examples-api-use/demo -c 4 -D9
     # Evolution of color
-    demo10: examples-api-use/demo -c 4 -L -D10
+    demo10: examples-api-use/demo -c 4 -D10
     # Brightness pulse generator
-    demo11: examples-api-use/demo -c 4 -L --led-pwm-bits=11 -D11
+    demo11: examples-api-use/demo -c 4 --led-pwm-bits=11 -D11
     # python sample: rotatatin block
-    pydemo1: bindings/python/samples/rotating-block-generator.py -c 4 -L --led-show-refresh
+    pydemo1: bindings/python/samples/rotating-block-generator.py -c 4 --led-show-refresh
     # python sample: like demo01
-    pydemo2: bindings/python/samples/image-scroller.py -c 4 -L --led-show-refresh -i examples-api-use/runtext.ppm
+    pydemo2: bindings/python/samples/image-scroller.py -c 4 --led-show-refresh -i examples-api-use/runtext.ppm
     # python sample: rotatatin block
-    pydemo3: bindings/python/samples/simple-square.py -c 4 -L --led-show-refresh
+    pydemo3: bindings/python/samples/simple-square.py -c 4 --led-show-refresh
+
+vaping:
+  host: himbeere
+  docker:
+    build: vaping
+    ports: 6080:7021
+
 

+ 19 - 0
vaping/Dockerfile

@@ -0,0 +1,19 @@
+FROM resin/rpi-raspbian:jessie-20170531
+
+RUN apt-get update
+RUN apt-get install -y curl vim mc gcc python-dev  python-pip
+# netbase is needed for fping
+RUN apt-get install -y netbase fping
+
+RUN pip install --upgrade pip setuptools
+
+RUN pip install vodka graphsrv
+RUN pip install vaping
+
+COPY config.yml /vaping/config.yml
+EXPOSE 7021
+
+
+
+CMD vaping --home=/vaping/ --debug  --verbose start
+

+ 98 - 0
vaping/config.yml

@@ -0,0 +1,98 @@
+probes:
+  - name: latency
+    type: std_fping
+    output:
+      - vodka
+
+    public_dns:
+      hosts:
+        - host: 8.8.8.8
+          name: Google
+          color: red
+        - host: 4.2.2.1
+          name: Level(3)
+          color: blue
+        - host: 208.67.222.222
+          name: OpenDNS
+          color: orange
+    raspis:
+      hosts:
+        - host: 192.168.178.49
+          name: Blaubeere
+          color: red
+        - host: 192.168.178.43
+          name: Himbeere
+          color: blue
+
+plugins:
+  - name: std_fping
+    type: fping
+    count: 10
+    interval: 3s
+    output:
+      - vodka
+
+  - name: vodka
+    type: vodka
+    logging:
+      version: 1
+      formatters:
+        simple:
+          format: '%(asctime)s - %(name)s - %(levelname)s: %(message)s'
+      handlers:
+        console:
+          class: logging.StreamHandler
+          level: DEBUG
+          formatter: simple
+          stream: ext://sys.stdout
+      loggers:
+        vodka:
+          level: DEBUG
+          handlers:
+            - console
+
+    data:
+      - type: fping
+        handlers:
+          - type: index
+            index: host
+          - type: store
+            container: list
+            limit: 500
+
+    apps:
+      graphsrv:
+        tmpl_engine: jinja2
+        enabled: true
+        graphs:
+          multitarget:
+            id_field: host
+            type: multitarget
+            plot_y: avg
+            format_y: ms
+
+          smokestack:
+            id_field: host
+            type: smokestack
+            plot_y: avg
+
+    plugins:
+
+      - name: http
+        type: flask
+        host: 0.0.0.0
+        port: 7021
+        debug: true
+        static_url_path: /static
+        server: self
+        async: thread
+        routes:
+          /targets : graphsrv->targets
+          /graph_data :
+            methods:
+              - POST
+              - GET
+            target: graphsrv->graph_data
+          /graph : graphsrv->graph_view
+          /overview_read_file : graphsrv->overview_read_file
+          /: graphsrv->overview_view