9 Commits

Author SHA1 Message Date
Sven Holz
b41527a2e6 workflow added 2022-06-21 11:34:28 +02:00
Sven Holz
8b173ff9ee workflow added 2022-06-21 11:21:43 +02:00
Sven Holz
8407bf1250 workflow added 2022-06-21 11:19:15 +02:00
Sven Holz
b51db3e64d moved from self build docker image to gockerhub 2022-06-21 11:13:49 +02:00
Sven Holz
cb6b8e1aae add default values to env variables description 2022-06-20 17:50:43 +02:00
Sven Holz
1772f7d929 add default values to env variables description 2022-06-20 17:50:08 +02:00
Sven Holz
1850598038 add default values to env variables description 2022-06-20 17:46:30 +02:00
Sven Holz
c6e1cc3448 add default values to env variables description 2022-06-20 17:45:18 +02:00
Sven Holz
06cfd448da add default values to env variables description 2022-06-20 17:38:50 +02:00
4 changed files with 82 additions and 14 deletions

65
.github/workflows/git2docker.yml vendored Normal file
View File

@@ -0,0 +1,65 @@
# This is a basic workflow to help you get started with Actions
name: CI to Docker Hub
# Controls when the workflow will run
##on:
# Triggers the workflow on push or pull request events but only for the "master" branch
## push:
## branches: [ "master" ]
# Only update with new tag pushed
on:
push:
tags:
- "v*.*"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
steps:
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Check Out Repo
uses: actions/checkout@v3
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: ./Docker_Build/
file: ./Docker_Build/Dockerfile
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/pylatemon:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

View File

@@ -57,16 +57,16 @@ You can find everything under *./Docker_Build/* and in the python program itself
### ENV Variables
Name | Example | Usage | Option/Must
:------: | :-----: | :-----: | :-----:
INFLUX_URL | http://10.0.0.1:8086 | InfluxDB Host | must
INFLUX_TOKEN | eWOcp-MCv2Y3IJPlER7wc...ICKirhw0lwEczRNnrIoTqZAg== | InfluxDB API Token | must
INFLUX_BUCKET | latency | InfluxDB Bucket | must
INFLUX_ORG | MyOrg | InfluxDB Organization | must
TARGET_HOST | 8.8.8.8 | Monitored Host (IP/FQDN) | must
TARGET_TIMEOUT | 0.5 | ping timeout in sec. | option
TARGET_TIMER | 3 | ping frequency in sec. | option
TARGET_LOCATION | Google | decript. location | option
Name | Example | Usage | Option/Must | Type | Default
:------: | :-----: | :-----: | :-----: | :-----: | :-----:
INFLUX_URL | http://10.0.0.1:8086 | InfluxDB Host | must | URL | ---
INFLUX_TOKEN | eWOcp-MCv2YPlER7wc...0zRNnrIoTqZAg== | InfluxDB API Token | must | String | ---
INFLUX_BUCKET | latency | InfluxDB Bucket | must | String | ---
INFLUX_ORG | MyOrg | InfluxDB Organization | must | String | ---
TARGET_HOST | 8.8.8.8 | Monitored Host (IP/FQDN) | must | FQDN or IP | ---
TARGET_TIMEOUT | 0.5 | ping timeout in sec. | optional | Float >0 | **1**
TARGET_TIMER | 3 | ping frequency in sec. | optional | Int >1 | **5**
TARGET_LOCATION | Google | decript. location | optional | String |**unknown**
-----
@@ -76,7 +76,7 @@ TARGET_LOCATION | Google | decript. location | option
**Keep in mind it´s a OR decision not a AND**
See [./latency-monitor/config.ini](./latency-monitor/config.ini)
See [./latency-monitor/config-template.ini](./latency-monitor/config-template.ini)
**ENV wins over file**
@@ -245,7 +245,7 @@ Everything should be right in place now.
Just the certificates are missing look [here](#certificate)
Now run it and mybe pick a example dashboard for grafana from [here](#grafana-dashboard-examples)
Now just start over and maybe pick an example dashboard for grafana from [here](#grafana-dashboard-examples)
-----
-----
@@ -293,6 +293,9 @@ Contributors names and contact info
## Version History
- v0.4
- moved from self build iamge to dockerhub
- v0.3a
- ping timeout added
- cleanup

View File

@@ -120,7 +120,7 @@ services:
latency-monitor:
container_name: latency-monitor
hostname: latency-monitor
build: ./Docker_Build
image: planetespresso/pylatemon
depends_on:
- influxdb
restart: always

View File

@@ -6,7 +6,7 @@ services:
latency-monitor:
container_name: latency-monitor
hostname: latency-monitor
build: ./Docker_Build
image: planetespresso/pylatemon
restart: always
volumes:
# - ./latency-monitor/config.ini:/app/config.ini:ro # UNCOMMENT IF NEEDED