Skip to content

Project running on linux used to monitor the network speed and tweet the details (WIP)

Notifications You must be signed in to change notification settings

paul-man/internetSpeedMonitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

internetSpeedMonitor

Please open a pull request with a better name :D

This project is twofold -- periodically test and store internet speed metrics in InfluxDB, and tweet the average measurements out daily. Cron is used to schedule the 2 separate jobs. Specdumb twitter account.

For the speed tests a Python library called speedtest-cli is used to calculate download (Mbit/s), upload (Mbit/s), and ping (ms)

Requirements

Usage

After cloning the repository:

  • Create config.ini and add twitter API credentials + Influx client data

    [twitter]
    API_KEY = {API_KEY}
    API_SECRET = {API_SECRET}
    ACCESS_KEY = {ACCESS_KEY}
    ACCESS_SECRET = {ACCESS_SECRET}
    
    [influxdb]
    ORG = {INFLUX ORG}
    HOST = localhost
    PORT = 8086
    USER = {INFLUX USER}
    TOKEN = {INFLUX TOKEN}
    BUCKET = internet_speed
    
  • $ pip3 install requirements.txt

    Install Python requirements

  • python3 main.py --speedtest

    Executes speedtest-cli and stores download, upload, ping data to configured InfluxDB

  • python3 main.py --tweet

    Queries InfluxDB and tweets the average for each metric (download, upload, ping) for measurements within passed 24 hours


Cron setup

You'll need data throughout the day which is why we'll use cron jobs to run our script every 15 minutes. You can add your own using sudo crontab -e or run the following command:

> (crontab -u <user> -l; echo "*/15 * * * * python3 /<path/to>/main.py --speedtest" ) | crontab -u <user> -

You can schedule the tweet to be sent at 8 PM using this command:

> (crontab -u <user> -l; echo "0 20 * * * python3 /<path/to>/main.py --tweet" ) | crontab -u <user> -`

About

Project running on linux used to monitor the network speed and tweet the details (WIP)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages