This project sets up a simple monitoring solution for home network's Internet Service Provider (ISP) performance. It uses Telegraf, InfluxDB, Grafana ( TIG ) stack, running in containers to collect data using various telegraf plugins and display it in an easy-to-understand graphical interface.
- InfluxDB is a high-performance time-series database used to store and analyze metrics and events data.
- Telegraf is an open-source agent that collects, processes, and sends metrics and data from various sources to different datastores like InfluxDB.
- Grafana is an open-source visualization and analytics software used for monitoring and analyzing data from various sources.
- Telegraf based on the input plugins will collect data about ping response times, internet speed, and DNS queries etc.
- Telegraf then sends the collected data to InfluxDB, which is a time-series database that stores and organizes the data.
- Grafana is then used to visualize the data collected by Telegraf and stored in InfluxDB, providing real-time monitoring of ping response times, internet speed, and DNS queries.
- Dashboards can be created in Grafana to display the data in a graphical format, for example sample dashboard included in this repo.
NOTE:
The entire stack can be deployed using docker or podman.
The individual components can be installed as containers or natively as well.
- Clone this repository using following command:
Using SSH
---------
git clone git@github.com:UchihaItachiSama/ISP-Watchtower.git
OR
Using HTTPS
-----------
git clone https://github.com/UchihaItachiSama/ISP-Watchtower.git
- Have the required packages installed for example if using docker based installation have docker, docker-compose installed, similarly for podman have required setup completed before proceeding.
- Following are the files in the repository
ISP-Watchtower/monitoring/telegraf/telegraf.conf
contains the telegraf configuration for input and output plugins.ISP-Watchtower/monitoring/grafana/provisioning/datasources/
folder contains the InfluxDB datasource YAML file.ISP-Watchtower/monitoring/grafana/provisioning/dashboards/
contains the dashboard YAML and JSON file.ISP-Watchtower/monitoring/podman/
contains the Kubernetes YAML definition files for deploying the volumes & pods using podman.ISP-Watchtower/monitoring/docker/
contains thedocker-compose.yaml
file to deploy the stack using docker.
ISP-Watchtower/monitoring
├── docker
│ └── docker-compose.yaml
├── grafana
│ └── provisioning
│ ├── dashboards
│ │ ├── dashboard.yaml
│ │ └── isp-watchtower.json
│ └── datasources
│ └── datasources.yaml
├── podman
│ ├── grafana-pod.yaml
│ ├── influxdb-pod.yaml
│ ├── persistent-volumes.yaml
│ └── telegraf-pod.yaml
├── telegraf
│ └── telegraf.conf
└── tools
└── manage-pods.sh
- Refer to below section if deploying the TIG container stack using podman
- Move to the
monitoring
folder
cd ISP-Watchtower/monitoring/
- Create the volumes for Grafana and InfluxDB
podman kube play podman/persistent-volumes.yaml
--
podman volume ls
DRIVER VOLUME NAME
local grafana-data-pvc
local influxdb-data-pvc
- Deploy the pods
podman kube play podman/influxdb-pod.yaml
podman kube play podman/telegraf-pod.yaml
podman kube play podman/grafana-pod.yaml
- Confirm the pods are up and running
podman pod ls
POD ID NAME STATUS CREATED INFRA ID # OF CONTAINERS
97ed8c6fac51 telegraf Running 6 hours ago 1bc9fe7c0c88 2
35dc24ddfd6b grafana Running 6 hours ago 56cd68dfa7df 2
4a5d27ddc17b influxdb Running 6 hours ago 0e7128f3fb93 2
- If using any firewall filtering on host, allow the connection for TCP port
3000
- Connect to Grafana UI on
http://<host-ip>:3000/
- Login using username / password set in
grafana-pod.yaml
, password can be changed to a stronger password at login. - Confirm datasource
Home -> Connections -> Data sources -> influxdb
is visible and tested to be working. - Open the
Home -> Dashboards -> ISP Watchtower
dashboard.
- Refer to below section if deploying the TIG container stack using docker
- Move to the
monitoring
folder
cd ISP-Watchtower/monitoring
- Using the
docker-compose.yaml
file present underISP-Watchtower/monitoring/docker/
folder deploy the stack
docker-compose -p gondor -f docker/docker-compose.yaml up -d
- Confirm the containers are up and running
docker-compose -p gondor -f docker/docker-compose.yaml ps -a
Name Command State Ports
------------------------------------------------------------------------------------------------------------------------------------------------
grafana /run.sh Up 0.0.0.0:3000->3000/tcp,:::3000->3000/tcp
influxdb /entrypoint.sh -config /et ... Up 0.0.0.0:8086->8086/tcp,:::8086->8086/tcp
telegraf /entrypoint.sh telegraf Up 0.0.0.0:8092->8092/tcp,:::8092->8092/tcp, 8092/udp, 0.0.0.0:8094->8094/tcp,:::8094->8094/tcp,
0.0.0.0:8125->8125/tcp,:::8125->8125/tcp, 8125/udp
- Connect to Grafana UI on
http://<host-ip>:3000/
- Login using username / password set for grafana service in
docker-compose.yaml
, password can be changed to a stronger password at login. - Confirm datasource
Home -> Connections -> Data sources -> influxdb
is visible and tested to be working - Open the
Home -> Dashboards -> ISP Watchtower
dashboard