It's a bandwidth, IP tracker and a bot daemon that is monitoring the network peformance in a server, built upon JS instructions, it's intended to run periodically and save the results in a json file.
It makes use of:
- lowdb as a lite db_init in json format.
- speedtest-cli to run the speed tests from the command line.
- pm2 process manager to run this script as a daemon system.
If you work with multiple projects and different development environments, I endorse you to use versioning manager systems like NVM for NodeJS, PYENV for Python, RBENV for Ruby and others to easily handle and switch among different versions of your favorite programming languages and its development backgrounds.
-
Install SpeedTest-cli:
pip install speedtest-cli
-
Install PM2 globally:
npm install -g pm2
-
Install LowDB and the Node Telegram Bot Api: Run
npm install
from theShell
, it makes use of the package.json in the source directory, or if you prefer, follow the instructions from the provided link.
The settings.js module is offered to customize the arguments passed globally, so you must customize the module to fits it to your needs.
Check that your system accomplish the requirements and everything works perfectly. There are two ways to run this script as a daemon.
From the console:
- If you are in the source path, run:
npm run daemon
- From anywhere, replace the path and run:
pm2 start your/path/to/index.js
Please help me tracking any issue that could appear, feel free to fork and send a pull request, comment, review, or report an issue on this repo.
If you test it in a Windows environment, let me know your experience.
- Deploy on my own server.
- Implement a telegram bot to notify relevant changes in data.
- Make it accessible from the web.
- Enhance its performance with concurrent threads.
- Implement a GUI to visualize and explore the data collected.
- Write a Shell script to ease the auto-installation.
This project was inspired by @healycodes and his recent work. It was recently published on Dev.to.