Created
May 10, 2012 07:08
-
-
Save berg/2651593 to your computer and use it in GitHub Desktop.
Script to poll iptables counters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# iptables counter poller | |
# released under CC0 (public domain) | |
while true; do | |
((date +%s; \ | |
iptables -t mangle -x -L FORWARD -vvv -n \ | |
| tail +3 \ | |
| awk '{print $2}') \ | |
| tr '\n' ' '; echo '') >> /var/tmp/log.txt | |
sleep 1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment