aboutsummaryrefslogtreecommitdiffstats
path: root/examples/old-stream-stuff/transcode/count.sh
diff options
context:
space:
mode:
authorroot <root@frank.tg14.gathering.org>2014-04-20 02:36:36 +0200
committerroot <root@frank.tg14.gathering.org>2014-04-20 02:36:36 +0200
commitb231e372681e6bfc499fd2aadda840e0b607278f (patch)
treed7f742eba33c5317417d5f53f6fa61287b2ba8ae /examples/old-stream-stuff/transcode/count.sh
parent65f98b040aaff35202fa1e79c4f74fcdaf09329f (diff)
Removed files from the root-directory. Moved into 'examples' dir.
Diffstat (limited to 'examples/old-stream-stuff/transcode/count.sh')
-rwxr-xr-xexamples/old-stream-stuff/transcode/count.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/examples/old-stream-stuff/transcode/count.sh b/examples/old-stream-stuff/transcode/count.sh
new file mode 100755
index 0000000..22f6aa1
--- /dev/null
+++ b/examples/old-stream-stuff/transcode/count.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+while :; do
+ date=$(date +"%Y-%m-%d-%H:%M:%S")
+ ( lsof -n | grep vlc ; ssh root@gaffeltruck.tg12.gathering.org 'lsof -n | grep vlc' ) > /var/log/stream-count/$date
+ for PORT in 3013 5013 3014 5014 3015; do
+ for PROTO in IPv4 IPv6; do
+ # 176.110.x.x / 2a01:798:76a:125:: -> TG12
+ # 176.31.230.19 / 2001:41d0:2:f700::2 -> OVH box
+ cat /var/log/stream-count/$date | grep EST | egrep $PROTO | egrep "(176\.31\.230\.19|2001:41d0:2:f700::.*):$PORT->" | cut -d'>' -f2 | sed 's/:[0-9]\+ (ESTABLISHED)//' | sort -u | grep -vEc 'fisk' | while read foo; do echo "$date $PORT $PROTO foreign $foo"; done | tee -a count_datacube.log
+ cat /var/log/stream-count/$date | grep EST | egrep $PROTO | egrep "(176\.110\..*|2a01:798:76a:125::.*):$PORT->" | cut -d'>' -f2 | sed 's/:[0-9]\+ (ESTABLISHED)//' | sort -u | grep -vEc -e "\[2a01:798:76a:|176\.110\." | while read foo; do echo "$date $PORT $PROTO external $foo"; done | tee -a count_datacube.log
+ cat /var/log/stream-count/$date | grep EST | egrep $PROTO | egrep "(176\.110\..*|2a01:798:76a:125::.*):$PORT->" | cut -d'>' -f2 | sed 's/:[0-9]\+ (ESTABLISHED)//' | sort -u | grep -Ec -e "\[2a01:798:76a:|176\.110\." | while read foo; do echo "$date $PORT $PROTO internal $foo"; done | tee -a count_datacube.log
+ done
+ done
+ sleep 60
+done;
+