A Raspberry Pi network monitor running Nagios and Grafana gives you real-time visibility into your home or office network — tracking bandwidth usage, device availability, latency, and service health. This is the same monitoring stack used by enterprise IT teams, running on hardware that costs less than a single month of commercial monitoring subscriptions.
Table of Contents
- Why Monitor Your Network
- Hardware Requirements
- The Monitoring Stack
- Setting Up Nagios Core
- InfluxDB and Grafana Dashboard
- Configuring Alerts and Notifications
- What to Monitor on an Indian Network
- Frequently Asked Questions
- Conclusion
Why Monitor Your Network
Without monitoring, you discover network problems when users complain. With a Pi-based monitoring system, you detect issues before they affect anyone:
- ISP performance tracking: Log actual download/upload speeds from your Indian ISP (JioFiber, Airtel, ACT) and identify when they underperform
- Device availability: Know instantly when a NAS, printer, access point, or smart home device goes offline
- Bandwidth monitoring: Identify which devices consume the most bandwidth
- Latency tracking: Monitor ping times to critical services (your office VPN, cloud servers, gaming servers)
- Historical data: Prove to your ISP that speeds dropped during specific hours with timestamped evidence
Hardware Requirements
- Raspberry Pi 5 (4GB sufficient for monitoring 20-50 devices)
- MicroSD card (32GB) or NVMe SSD (recommended for database writes)
- Ethernet cable (wired connection is essential for accurate network measurements)
- USB-C power supply (5V/5A)
- Case with cooling
Always connect the monitoring Pi via Ethernet, not Wi-Fi. Wi-Fi introduces variable latency that corrupts your monitoring data — you need the Pi to have a stable, low-latency connection to measure everything else accurately.
The Monitoring Stack
The recommended stack uses three components, each handling a different aspect:
- Nagios Core: Active monitoring — pings devices, checks service ports, sends alerts when things go down
- InfluxDB: Time-series database — stores historical metrics (bandwidth, latency, temperature) efficiently
- Grafana: Visualisation — creates dashboards with graphs, gauges, and tables from InfluxDB data
For simpler setups, you can use Prometheus instead of InfluxDB, or skip Nagios and use only Grafana with data collectors. But the full stack provides the most comprehensive monitoring.
Setting Up Nagios Core
Install Nagios Core:
sudo apt update && sudo apt install -y nagios4 nagios-plugins nagios-nrpe-plugin
sudo systemctl enable nagios4
Access the Nagios web interface at http://pi-ip/nagios4. Default credentials are nagiosadmin with the password you set during installation.
Add devices to monitor:
Create host definitions in /etc/nagios4/conf.d/. For example, to monitor your router:
# /etc/nagios4/conf.d/network-devices.cfg
define host {
use generic-host
host_name router
alias Home Router
address 192.168.1.1
max_check_attempts 3
check_period 24x7
notification_interval 30
notification_period 24x7
}
define host {
use generic-host
host_name nas
alias File Server
address 192.168.1.100
}
define service {
use generic-service
host_name router
service_description PING
check_command check_ping!100.0,20%!500.0,60%
}
Add similar definitions for every device you want to monitor — NAS, access points, smart home hubs, printers, and desktop machines. Nagios pings each device at configurable intervals and alerts you when a device stops responding.
InfluxDB and Grafana Dashboard
Install InfluxDB:
sudo apt install -y influxdb influxdb-client
sudo systemctl enable influxdb
Install Grafana:
sudo apt install -y grafana
sudo systemctl enable grafana-server
sudo systemctl start grafana-server
Access Grafana at http://pi-ip:3000 (default login: admin/admin).
Create a speed test data collector:
sudo apt install -y speedtest-cli
Create a script that runs speedtest every 30 minutes and writes results to InfluxDB:
#!/bin/bash
# /home/pi/speedtest-logger.sh
RESULT=$(speedtest-cli --simple)
DOWNLOAD=$(echo "$RESULT" | grep "Download" | awk '{print $2}')
UPLOAD=$(echo "$RESULT" | grep "Upload" | awk '{print $2}')
PING=$(echo "$RESULT" | grep "Ping" | awk '{print $2}')
curl -i -XPOST 'http://localhost:8086/write?db=network'
--data-binary "speedtest download=${DOWNLOAD},upload=${UPLOAD},ping=${PING}"
Add to crontab: */30 * * * * /home/pi/speedtest-logger.sh
In Grafana, add InfluxDB as a data source and create panels showing download speed, upload speed, and latency over time. Within a day, you will have clear evidence of your ISP’s actual performance versus advertised speeds.
Additional data collectors:
- Telegraf: Collects system metrics (CPU, RAM, disk, network traffic) from the Pi itself and other Linux machines
- SNMP: Queries managed switches and routers for port-level traffic statistics
- Ping collector: Logs round-trip times to key hosts (Google DNS, your office, gaming servers) every minute
Configuring Alerts and Notifications
Nagios email alerts: Configure Nagios to send email notifications when a device goes down or a service becomes unreachable. Edit /etc/nagios4/objects/contacts.cfg with your email address.
Telegram alerts: For instant notifications on your phone, integrate Nagios with Telegram via a notification script. Create a Telegram bot and add a custom notification command that sends alerts to your Telegram chat.
Grafana alerts: Grafana can trigger alerts based on metric thresholds. Set up alerts for: ISP speed dropping below a threshold, devices going offline, disk usage exceeding limits, or temperature exceeding safe levels.
What to Monitor on an Indian Network
ISP performance:
- Download/upload speed vs plan speed (run speed tests every 30 minutes)
- Latency to Indian servers (Mumbai, Chennai, Delhi data centres)
- DNS resolution time (is your ISP’s DNS slow?)
- Packet loss percentage (common during peak hours on some Indian ISPs)
Home network:
- Wi-Fi access point uptime and signal quality
- Smart home devices (bulbs, cameras, sensors) — these often silently disconnect
- NAS and file server availability
- Printer online status
Office network:
- Internet gateway availability and failover status
- VPN tunnel status
- Critical application servers (ERP, email, CRM)
- UPS battery status and power input
Frequently Asked Questions
Can a Raspberry Pi handle monitoring 50+ devices?
Yes. Nagios on a Pi 5 4GB comfortably monitors 50-100 devices with standard ping and port checks. The bottleneck is usually database writes if you collect metrics at very high frequency. Use NVMe storage for write-heavy monitoring.
Is there a simpler alternative to Nagios?
Yes. Uptime Kuma is a modern, lightweight monitoring tool with a clean web interface. Install it with Docker: docker run -d -p 3001:3001 louislam/uptime-kuma. It monitors URLs, ports, and ping with built-in notifications — easier to set up than Nagios, though less powerful for complex monitoring.
How much storage does monitoring data use?
InfluxDB is efficient with time-series data. Monitoring 20 devices with 5-minute intervals generates roughly 100MB per month. A year of data fits easily on a 32GB SD card. For high-frequency monitoring (every 30 seconds across 50+ devices), use NVMe storage.
Can I access the monitoring dashboard from my phone?
Yes. Grafana’s web interface is responsive and works on mobile browsers. For remote access outside your home network, use Tailscale VPN (free) to securely access the Pi’s Grafana from anywhere.
Does this work with JioFiber/Airtel/ACT?
Yes. The monitoring system is independent of your ISP — it just measures what the ISP delivers. In fact, one of the most valuable uses is documenting ISP performance over time to support complaints or plan upgrades.
Conclusion
A Raspberry Pi network monitor transforms your understanding of your network. Instead of guessing why the internet feels slow or not knowing when devices go offline, you have concrete data and immediate alerts. The Nagios + InfluxDB + Grafana stack provides enterprise-grade monitoring at the cost of a single Pi and an afternoon of setup.
Start by monitoring your ISP speed and pinging your critical devices. Once you see the first dashboard come to life with real data, you will want to monitor everything.
Get your Raspberry Pi 5 for network monitoring from Zbotic — fast shipping across India.
Add comment