Skip to content

Commit

Permalink
Completed 1.0.0 of Netprobe Lite
Browse files Browse the repository at this point in the history
  • Loading branch information
securedpackets committed Nov 28, 2023
1 parent 2aec559 commit b93170f
Show file tree
Hide file tree
Showing 18 changed files with 4,328 additions and 1 deletion.
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM ubuntu:latest

COPY requirements.txt /netprobe_lite/requirements.txt

# Install python/pip
ENV PYTHONUNBUFFERED=1
RUN apt-get update -y \
&& apt-get upgrade -y \
&& apt-get install -y python3 \
&& apt-get install -y python3-pip \
&& apt-get install -y iputils-ping \
&& pip install -r /netprobe_lite/requirements.txt

WORKDIR /netprobe_lite

ENTRYPOINT [ "/bin/bash", "./entrypoint.sh" ]
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,34 @@
Hello world!
# Netprobe Lite

Simple and effective tool for measuring ISP performance at home. The tool measures several performance metrics including packet loss, latency and DNS performance. It also aggregates these metrics into a common score, which you can use to monitor overall health of your internet connection.

## Requirements and Setup

To run Netprobe Lite, you'll need a PC running Docker connected directly to your ISP router. Specificially:

1. Netprobe Lite requires the latest version of Docker. For instructions on installing Docker, see YouTube, it's super easy.

2. Netprobe Lite should be installed on a machine (the 'probe') which has a wired Ethernet connectiont to your primary ISP router. This ensures the tests are accurately measuring your ISP performance and excluding and interference from your home network. An old PC with Linux installed is a great option for this.

# Installation

1. Clone the repo locally to the probe machine:

```
git clone https://github.com/riyaadali/netprobe_lite.git
```

2. From the cloned folder, using docker compose to launch the app:

```
docker compose up
```

# How to use

1. Navigate to: http://x.x.x.x:3001/ where x.x.x.x = IP of the probe machine running Docker.

2. Default user / pass is 'admin/admin'. Login to Grafana and set a custom password.

3. Click on 'Menu -> Dashboards -> Netprobe' to view the dashboard (you should add the URL as a bookmark).

35 changes: 35 additions & 0 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
services:
redis:
container_name: redis
image: "redis:latest"
volumes:
- ./config/redis/redis.conf:/etc/redis/redis.conf
netprobe:
container_name: netprobe
build: .
volumes:
- .:/netprobe_lite
environment:
MODULE: "NETPROBE"
presentation:
container_name: presentation
build: .
volumes:
- .:/netprobe_lite
environment:
MODULE: "PRESENTATION"
prometheus:
container_name: prometheus
image: "prom/prometheus"
volumes:
- ./config/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
grafana:
image: grafana/grafana-enterprise
container_name: grafana
volumes:
- ./config/grafana/datasources/automatic.yml:/etc/grafana/provisioning/datasources/automatic.yml
- ./config/grafana/dashboards/main.yml:/etc/grafana/provisioning/dashboards/main.yml
- ./config/grafana/dashboards/netprobe.json:/var/lib/grafana/dashboards/netprobe.json

ports:
- '3001:3000'
53 changes: 53 additions & 0 deletions config/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import os
from dotenv import load_dotenv

# Load configs from env

try: # Try to load env vars from file, if fails pass
load_dotenv()
except:
pass


# Create class for each

class Config_Netprobe():
probe_interval = int(os.getenv('PROBE_INTERVAL'))
probe_count = int(os.getenv('PROBE_COUNT'))
sites = os.getenv('SITES').split(',')
device_id = os.getenv('DEVICE_ID')
site_id = os.getenv('SITE_ID')
dns_test_site = os.getenv('DNS_TEST_SITE')

DNS_NAMESERVER_1 = os.getenv('DNS_NAMESERVER_1')
DNS_NAMESERVER_1_IP = os.getenv('DNS_NAMESERVER_1_IP')
DNS_NAMESERVER_2 = os.getenv('DNS_NAMESERVER_2')
DNS_NAMESERVER_2_IP = os.getenv('DNS_NAMESERVER_2_IP')
DNS_NAMESERVER_3 = os.getenv('DNS_NAMESERVER_3')
DNS_NAMESERVER_3_IP = os.getenv('DNS_NAMESERVER_3_IP')

nameservers = [
(DNS_NAMESERVER_1,DNS_NAMESERVER_1_IP),
(DNS_NAMESERVER_2,DNS_NAMESERVER_2_IP),
(DNS_NAMESERVER_3,DNS_NAMESERVER_3_IP),
]

class Config_Redis():
redis_url = os.getenv('REDIS_URL')
redis_port = os.getenv('REDIS_PORT')
redis_password = os.getenv('REDIS_PASSWORD')

class Config_Presentation():
presentation_port = int(os.getenv('PRESENTATION_PORT'))
presentation_interface = os.getenv('PRESENTATION_INTERFACE')
device_id = os.getenv('DEVICE_ID')

weight_loss = float(os.getenv('weight_loss'))
weight_latency = float(os.getenv('weight_latency'))
weight_jitter = float(os.getenv('weight_jitter'))
weight_dns_latency = float(os.getenv('weight_dns_latency'))

threshold_loss = int(os.getenv('threshold_loss'))
threshold_latency = int(os.getenv('threshold_latency'))
threshold_jitter = int(os.getenv('threshold_jitter'))
threshold_dns_latency = int(os.getenv('threshold_dns_latency'))
12 changes: 12 additions & 0 deletions config/grafana/dashboards/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: 1

providers:
- name: "Dashboard provider"
orgId: 1
type: file
disableDeletion: false
updateIntervalSeconds: 10
allowUiUpdates: false
options:
path: /var/lib/grafana/dashboards
foldersFromFilesStructure: true
Loading

0 comments on commit b93170f

Please sign in to comment.