Skip to content

Instantly share code, notes, and snippets.

@shirou
Created September 19, 2024 13:35
Show Gist options
  • Save shirou/b4429def8a14a56879783eb051020175 to your computer and use it in GitHub Desktop.
Save shirou/b4429def8a14a56879783eb051020175 to your computer and use it in GitHub Desktop.
run nethogs to watch network traffic
[Unit]
Description=network usage by nethogs
After=network.target
[Service]
Type=simple
ExecStart=/home/shirou/nethogs.sh
Restart=always
RestartSec=5
StartLimitInterval=0
StartLimitBurst=5
# Logging
StandardOutput=append:/var/log/nethogs.log
StandardError=append:/var/log/nethogs.log
[Install]
WantedBy=multi-user.target
#!/usr/bin/env bash
/usr/sbin/nethogs -v 1 -d 10 -t wlan0 | grep -vi unknown
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment