An open API service indexing awesome lists of open source software.

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

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).