Skip to content

Commit 3902b7b

Browse files
authored
capture egress traffic on non-loopback interface only (#527)
1 parent 91f2a22 commit 3902b7b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

ansible/files/admin_api_scripts/pg_egress_collect.pl

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
# This script receive tcpdump output through STDIN and does:
44
#
5-
# 1. extract outgoing TCP packet length on all devices port 5432 and 6543
5+
# 1. extract outgoing TCP packet length on the 1st non-loopback device port 5432 and 6543
66
# 2. sum the length up to one minute
77
# 3. save the total length to file (default is /tmp/pg_egress_collect.txt) per minute
88
#
99
# Usage:
1010
#
11-
# tcpdump -s 128 -Q out -i any -nn -tt -vv -p -l 'tcp and (port 5432 or port 6543)' | perl pg_egress_collect.pl -o /tmp/output.txt
11+
# tcpdump -s 128 -Q out -nn -tt -vv -p -l 'tcp and (port 5432 or port 6543)' | perl pg_egress_collect.pl -o /tmp/output.txt
1212
#
1313

1414
use POSIX;

ansible/files/pg_egress_collect.service.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Description=Postgres Egress Collector
33

44
[Service]
55
Type=simple
6-
ExecStart=/bin/bash -c "tcpdump -s 128 -Q out -i any -nn -tt -vv -p -l 'tcp and (port 5432 or port 6543)' | perl /root/pg_egress_collect.pl"
6+
ExecStart=/bin/bash -c "tcpdump -s 128 -Q out -nn -tt -vv -p -l 'tcp and (port 5432 or port 6543)' | perl /root/pg_egress_collect.pl"
77
User=root
88
Slice=services.slice
99
Restart=always

0 commit comments

Comments
 (0)