Skip to content
Snippets Groups Projects
Select Git revision
  • dcabf4fe4ee96b8c201c48e5e42e6e07f53f1a06
  • master default protected
  • fix/dont_save_partition_table_of_mapper_devices
  • fix_11285
  • debian
  • pristine-tar
  • upstream
  • backupninja_debian/1.0.2-1
  • backupninja_upstream/1.0.2
  • backupninja-1.0.2
  • backupninja_debian/1.0.1-2
  • backupninja_debian/1.0.1-1
  • backupninja_upstream/1.0.1
  • backupninja-1.0.1
  • backupninja_debian/1.0-1
  • backupninja_upstream/1.0
  • backupninja-1.0
  • backupninja_debian/1.0_rc1-1
  • backupninja_upstream/1.0_rc1
  • backupninja-1.0-rc1
  • backupninja_debian/0.9.10-2
  • backupninja_debian/0.9.10-1
  • backupninja_upstream/0.9.10
  • backupninja-0.9.10
  • backupninja_debian/0.9.9-1
  • backupninja-0.9.9
  • backupninja-0.9.8.1
27 results

man

  • Clone with SSH
  • Clone with HTTPS
  • Forked from Liberate / backupninja
    Source project has a limited visibility.

    Netsloth

    This is a simple script that calls various benchmarking and network troubleshooting tools and uploads this data to InfluxDB.

    Set up InfluxDB

    For testing, the easy thing to do is run the InfluxDB container on a server:

    docker run --rm --name influxdb -p 8086:8086 -v influx_volume:/var/lib/influxdb2 influxdb:latest

    Open http://myserver:8086 to set up initial user. Alternately, see https://hub.docker.com/_/influxdb/ for many ways to initialize the container with an already created user.

    When it asks you to set up InfluxDB just ignore that step.

    After creating your user, the next thing you must do is create a bucket. Navigate to Load Data > Buckets > Create Bucket. Change 'config.yml' entry 'bucket' to match the name you gave the bucket.

    Next create an API token from Load Data > API Tokens > Generate API Token.

    Configuration

    Edit the file config/config.yml with the bucket and API token you created in the setup.

    Helper programs

    iperf3:

    sudo apt install iperf3

    miniooni:

    download from https://github.com/ooni/probe-cli/releases

    Run

    Run netsloth:

    bin/netsloth

    Docker

    Run the image directly from the registry:

    docker run -it -e USER=calyx -e LOCATION=nyc -e DEVICE=mifi-m2000 registry.0xacab.org/calyx/gems/netsloth:latest

    Build image:

    docker build -t netsloth .

    Run locally built image:

    docker run -it -e USER=calyx -e LOCATION=nyc -e DEVICE=mifi-m2000 netsloth

    Further Reading

    InfluxDB client gem: https://github.com/influxdata/influxdb-client-ruby

    Querying data in Flux: https://docs.influxdata.com/influxdb/cloud/query-data/flux/

    Classes on learning InfluxDB: https://university.influxdata.com/

    Example Graphs

    A simple graph showing the aggregate bandwidth for all users at a specific location, grouped in 5 minute windows:

    from(bucket: "network")
      |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
      |> filter(fn: (r) => r["_measurement"] == "iperf3")
      |> filter(fn: (r) => r["_field"] == "receiver_bits_per_second")
      |> filter(fn: (r) => r["location"] == "seattle")
      |> drop(columns: ["user"])
      |> aggregateWindow(every: 5m, fn: median, createEmpty: false)
      |> yield(name: "median")

    If you want to further aggregate over all devices:

      |> drop(columns: ["user", "device"])

    Using calyxos and termux

    Install termux from f-droid

    Open termux and install packages: pkg update && pkg install curl git ruby iperf3

    Clone netsloth and install packages

    git clone https://0xacab.org/calyx/experiments/netsloth.git
    cd netsloth
    bundle install

    Download miniooni: curl -L -O "https://github.com/ooni/probe-cli/releases/download/v3.17.2/miniooni-android-arm64" && chmod +x miniooni-android-arm64

    Change variables in config/config.yml to match your location, device, etc.

    By default iperf3_cmd is located at /data/data/com.termux/files/user/bin/iperf3