This repository, telegraf-edgeos, is a lightweight, customized version of Telegraf, designed specifically for use with Ubiquiti's EdgeOS devices (e.g., EdgeRouter). Its purpose is to collect and report system and network metrics from EdgeOS devices in a resource-efficient manner.
What Does It Do?
Optimized Telegraf Build:
The repository provides a cross-compiled Telegraf binary for MIPS and MIPSEL architectures, which are commonly used by EdgeRouters.
The binary is stripped down to include only the necessary plugins for basic networking and system monitoring, resulting in a small binary size (~18 MB compared to the original ~210 MB).
Custom Metrics Collection:
The repo includes a custom shell script plugin (edgeos.sh) that collects additional EdgeOS-specific metrics:
Firmware: Checks for available firmware updates and reports the device model and serial number.
Interfaces: Reports details about network interfaces, including alias, up/down status, and negotiated speed.
Power: Gathers power statistics like voltage, current, and consumption (if supported by the hardware).
Temperature: Reports temperature readings for various sensors (e.g., CPU, Board, PHY chips).
Output Flavors:
The binary supports specific output formats such as InfluxDB and Prometheus for collecting and visualizing the metrics in tools like Grafana.
Sample Grafana Dashboard:
A pre-configured Grafana dashboard is included for visualizing the collected metrics. While it requires customization, it serves as a starting point for monitoring EdgeRouter devices.
Supported Hardware
The repository supports a variety of EdgeRouter models, but the feature set varies by hardware (e.g., power and temperature stats may not be available on all devices). The README includes a detailed compatibility table for various EdgeRouter models.
How to Use It?
Download and Install:
Download the pre-built .deb package for your device and install it using dpkg.
Use the provided Grafana dashboard JSON (grafana_edgerouter.json) to visualize the collected metrics.
Customize the dashboard to match your monitoring needs (e.g., add/remove metrics or adjust thresholds).
Upgrades:
Follow the same steps as installation to upgrade the package to a newer version.
Who Is It For?
This repository is intended for network administrators and EdgeRouter users who want to:
Monitor the performance and health of their EdgeRouter devices.
Collect metrics like CPU temperature, power consumption, interface status, and firmware versions.
Integrate with monitoring systems like InfluxDB and visualization tools like Grafana.
It is particularly useful for users who need a lightweight monitoring solution that fits within the limited resources of EdgeRouter devices.
Key Features:
Small binary size for resource-constrained devices.
Custom EdgeOS-specific metrics collection.
Pre-built Grafana dashboard for visualization.
Supports multiple EdgeRouter hardware models.
In summary, telegraf-edgeos provides an efficient and tailored monitoring solution for Ubiquiti EdgeRouters, enabling users to gain insights into their device's performance and health with minimal overhead.
Yes, telegraf-edgeos must be installed on the EdgeRouter itself because it is designed to run directly on Ubiquiti EdgeOS devices. However, Grafana does not need to be installed on the router. Here's how the setup works:
Telegraf on the Router
The telegraf-edgeos binary collects metrics directly from the router's operating system (EdgeOS).
It runs on the router to gather data about firmware, interfaces, power, and temperature.
The collected data is then sent to a metrics database (like InfluxDB or Prometheus) running on a separate server or machine.
Grafana on a Separate Machine
Grafana is not installed on the router. Instead, you install Grafana on a separate machine, such as:
A local server.
A cloud instance.
A dedicated monitoring system (e.g., a Raspberry Pi, Ubuntu/Debian machine, or a Docker container).
Grafana connects to the metrics database (e.g., InfluxDB or Prometheus) where the data collected by telegraf-edgeos is stored.
How It All Works Together
Telegraf on the Router:
Collects metrics and sends them to a central metrics database.
Metrics Database (e.g., InfluxDB or Prometheus):
Installed on a server or machine that is accessible by both the router and Grafana.
Stores the data sent by Telegraf.
Grafana:
Installed on a separate machine.
Connects to the metrics database to visualize the data in a dashboard.
Example Setup
Let's assume the following:
You have an EdgeRouter where you install telegraf-edgeos.
You have a server or machine running InfluxDB and Grafana.
Step 1: Install telegraf-edgeos on the EdgeRouter
Install the pre-built package for your router model: