Giter VIP home page Giter VIP logo

isp-monitor's Introduction

ISP Monitoring

This is a guide on how to monitor the quality of your ISP using InfluxDB and Telegraf.

Have you ever asked yourselve if internet is working properlly πŸ€”? Or without internet and waiting for it to come alive once again πŸ™‡β€β™‚οΈ? This setup will give you information of the quality and reliability of your ISP 😎. Oh, and did I mention Alerts 🚨when ISP is down or back online?

Dashboard

How it works

The goal is to setup an local Agent, running in your home 🏑, and make it report all that data to be monitored.

The default configuration of the Agent will ping every 10 seconds to google.com and 8.8.8.8. It will also measure DNS resolution to google.com domain using 8.8.8.8 and 1.1.1.1 DNS Servers.

How It Works

Provision your ISP Monitor

There are three different alternatives to deploy this stack

Requirements Metrics Notifications Ease of Install Remote Monitoring
InfluxDB Free Tier Raspberry Pi or similar βœ… βœ… Easy βœ…
Standalone Raspberry Pi or similar βœ… ❌ Medium ❌ Unless exposed
Self Hosting Raspberry Pi or similar + Cloud Hosting, VPS or similar βœ… βœ… Difficult βœ…

Using InfluxDB Free Tier

Build With Influx

Using Influxdata Free Tier as the managed cloud solution that combines InfluxDB + Grafana. And Telegraf in Raspberry Pi at your home.

Step 1 - Create Influxdb Account

  1. Create a Influxdb Cloud account
  2. Select Provider & Region (Maybe the one with a region near your location)
  3. Enter Company Name
  4. Click Next
  5. Choose Free Plan

Step 2 - Import Template

  1. Open your Influxdb Account
  2. On the sidebar. Settings > Templates
  3. Paste URL of Template https://raw.githubusercontent.com/sbehrends/isp-monitor/main/isp-monitor-influxdata-template.yml
  4. Click Lookup Tempalte
  5. Click Install Template

Step 3 - Update Webhook

  1. Click on Alerts
  2. Modify "Notification Endpoint" > "Webhook" with your own URL

Step 4 - Run Telegraf Agent

For reporting ISP Status we now require an Agent or Client that will run in your local network and report ISP status to InfluxDB.

This agent can be running on a Raspberry Pi, NAS or similar, and requires Telegraf to be installed.

  1. Get Telegraf configuration
  2. Click on Load Data > Telegraf
  3. Click on Setup Instructions under Network Monitor
  4. Click on Create New Token and use it for later configuration
  5. Use command from Telegraf Setup Instructions step 3

Under Telegraf Setup Instructions, you will find several alterantives to install Telegraf Agent. Keep in mind that $INFLUX_HOST; $INFLUX_TOKEN; $INFLUX_ORG are enviroment variables required by the Telegraf configuration provided.

  • INFLUX_HOST: Is the URL of influxdata in your region. You can grab it from the URL in the browser
  • INFLUX_TOKEN: Token generated in previous step
  • INFLUX_ORG: Visible on top-left. By default is your email.

Run with Docker

docker run -d --name=isp-monitor \
--restart=always \
-e INFLUX_TOKEN=REPLACE_TOKEN_FROM_STEP_ABOVE \
-e INFLUX_HOST=https://REPLACE_YOUR_REGION.cloud2.influxdata.com/ \
-e INFLUX_ORG=REPLACE_YOUR_ORG \
telegraf \
telegraf --config https://PASTE_URL_FROM_STEP_ABOVE
# docker-compose.yml
version: "2"
services:
  telegraf:
    image: telegraf
    restart: always
    command: telegraf --config https://PASTE_URL_FROM_STEP_ABOVE
    environment: 
      INFLUX_TOKEN: REPLACE_TOKEN_FROM_STEP_ABOVE
      INFLUX_HOST: https://REPLACE_YOUR_REGION.cloud2.influxdata.com/
      INFLUX_ORG: REPLACE_YOUR_ORG

[WIP] Standalone

Deploy Telegraf, InfluxDB and Granfana all in the same host, for example all in a Raspberry Pi running at your home.

Follow this repo as reference of this setup.

[WIP] Self Hosting

Deploy InfluxDB and Grafana on a Virtual Private Server, or similar cloud hosting. And Telegraf in Raspberry Pi at your home.

This is my personal current setup. I have not documented it all yet, but includes InfluxDB, Grafana and Let's Encrypt certs running in docker in a VPS. Besides Telegraf Agent there is a NodeJS service to measure Internet Speed (using speedtest-net) and Modem Signal Level (Only available for ISP Fibertel, Argentina).

Reference script is available in self-hosted folder.

Additional Tooling

I recommend Balena to orchestrate and deploy Raspberry Pi's with Telegraf agent. In my current setup I have 4 Raspberry Pi's managed by Balena reporting to my Self Hosted Influx + Grafana.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.