https://github.com/enindu/threshold
Threshold is a simple application based on systemd that automatically brings down a network interface after a specified amount of data has passed through it
https://github.com/enindu/threshold
automation cli command-line go golang linux network-usage network-utility networking systemd systemd-service
Last synced: about 2 months ago
JSON representation
Threshold is a simple application based on systemd that automatically brings down a network interface after a specified amount of data has passed through it
- Host: GitHub
- URL: https://github.com/enindu/threshold
- Owner: enindu
- License: gpl-3.0
- Created: 2025-06-11T18:36:53.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-06-12T15:53:04.000Z (about 1 year ago)
- Last Synced: 2025-07-02T03:37:31.298Z (12 months ago)
- Topics: automation, cli, command-line, go, golang, linux, network-usage, network-utility, networking, systemd, systemd-service
- Language: Go
- Homepage:
- Size: 43 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
# Threshold
Threshold is a simple command line tool to monitor network usage and disable network interface automatically when specified threshold is exeeded.
Threshold is based on [systemd](https://github.com/systemd/systemd), reads `/proc/net/dev` file to monitor network usage, and uses [netlink](https://github.com/vishvananda/netlink) package to manage network interfaces.
## Configuration
This application requires root privileges. You’ll need to install Threshold as root user and configure environment accordingly. Assuming you are logged in as root, add the following lines to the `/root/.bash_profile` file:
```bash
export PATH="$PATH:$HOME/go/bin"
export GOPATH="$HOME/go"
```
After updating `/root/.bash_profile`, you can apply changes by running:
```
source /root/.bash_profile
```
## Install
You can install Threshold using the `go install` command:
```
go install github.com/enindu/threshold@latest
```
## Usage
You can run Threshold using following syntax.
```
threshold : [arguments]
threshold [flags]
```
Display version message:
```
threshold -v # Or "threshold --version"
```
Display help message:
```
threshold -h # Or "threshold --help"
```
## License
This software is licensed under the GNU General Public License v3.0. You can view full license [here](https://github.com/enindu/threshold/blob/master/COPYING.md).