Zag-NetStats is a lightweight and efficient network monitoring tool written in Go. It collects and displays real-time statistics about network interfaces, including data transfer speeds and total usage. With a clean interface and customizable output formats, it’s suitable for developers, system administrators, and anyone who needs detailed network statistics.
- Real-Time Monitoring: View instantaneous upload and download speeds.
- Detailed Usage Statistics: Monitor total data sent, received, and overall usage.
- Customizable Output:
- JSON format for integration with other tools.
- Tabular format for a clear and human-readable display.
- Cross-Platform Support: Works on Linux, macOS, and Windows.
- Configurable Precision and Refresh Interval: Fine-tune precision and update frequency as needed.
- Go to the Releases page of the repository.
- Download the binary for your operating system.
- Extract the downloaded file.
- Run the binary:
./zag-netStats -i <interface_name>
- Ensure you have Go installed (version 1.23.2 or higher).
- Clone this repository:
git clone https://github.com/ShadowZagrosDev/Zag-NetStats.git cd Zag-NetStats
- Build the binary:
go build -o zag-netStats ./cmd/main.go
- Run the tool:
./zag-netStats -i <interface_name>
Option | Description | Default Value |
---|---|---|
-i (required) |
Specify the network interface to monitor. | N/A |
-t |
Refresh interval in seconds (1 to 3600). | 1 |
-p |
Precision for rounding numerical values (0 to 6). | 2 |
-f |
Output format: json or table . |
table |
Monitor a network interface (eth0
) with a refresh interval of 2 seconds and JSON output:
./zag-netStats -i eth0 -t 2 -f json
+-----------+------------+------------+------------+------------+-------------+
| Interface | Sent Speed | Recv Speed | Total Sent | Total Recv | Total Usage |
+-----------+------------+------------+------------+------------+-------------+
| eth0 | 12.34 MB/s | 56.78 MB/s | 1.23 GB | 4.56 GB | 5.79 GB |
+-----------+------------+------------+------------+------------+-------------+
{
"interface": "eth0",
"sentSpeed": { "value": 12.34, "unit": "MB/s" },
"recvSpeed": { "value": 56.78, "unit": "MB/s" },
"totalSent": { "value": 1.23, "unit": "GB" },
"totalRecv": { "value": 4.56, "unit": "GB" },
"totalUsage": { "value": 5.79, "unit": "GB" }
}
- Interface Selection: The tool retrieves network I/O statistics for the specified interface using gopsutil.
- Data Processing:
- Calculates instantaneous upload and download speeds.
- Computes total data sent and received since the start of monitoring.
- Output Rendering: Formats the data as a table or JSON for display.
This project is licensed under the MIT License. See the LICENSE file for details.
- gopsutil for providing cross-platform system utilities.
- tablewriter for rendering tabular output.
Made with ❤️ by ShadowZagrosDev