Skip to content

Commit 2cb82ec

Browse files
authored
Merge pull request #205 from dceara/fix-open-flow-collection
log-collector.sh: Fix collection of OF rules.
2 parents 5386da0 + 78dbee1 commit 2cb82ec

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

ovn-fake-multinode-utils/scripts/log-collector.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,34 @@
22

33
host=$1
44
node_name=$2
5-
limit=10
5+
limit=2
66

77
mkdir /tmp/${host}
88
pushd /tmp
99
for c in $(podman ps --format "{{.Names}}" --filter "name=${node_name}"); do
1010
mkdir ${host}/$c
1111
podman exec $c ps -aux > ${host}/$c/ps
1212
podman exec $c bash -c 'touch /tmp/process-monitor.exit && sleep 5'
13-
podman exec $c bash -c 'ovs-ofctl dump-flows br-int > /tmp/open-flows.log'
1413
podman cp $c:/var/log/ovn/ovn-controller.log ${host}/$c/
1514
podman cp $c:/var/log/openvswitch/ovs-vswitchd.log ${host}/$c/
1615
podman cp $c:/var/log/openvswitch/ovsdb-server.log ${host}/$c/
1716
podman cp $c:/etc/openvswitch/conf.db ${host}/$c/
1817
podman cp $c:/var/log/process-stats.json ${host}/$c/
19-
podman cp $c:/tmp/open-flows.log ${host}/$c/
2018
done
2119

2220
# Dump ovs groups just for latest ${limit} nodes
2321
for c in $(podman ps --format "{{.Names}}" --filter "name=${node_name}" --last "${limit}"); do
22+
podman exec $c bash -c 'ovs-ofctl dump-flows br-int > /tmp/open-flows.log'
2423
podman exec $c bash -c 'ovs-ofctl dump-groups br-int > /tmp/groups.log'
24+
podman cp $c:/tmp/open-flows.log ${host}/$c/
2525
podman cp $c:/tmp/groups.log ${host}/$c/
26+
27+
# OF rules/group dumps can be very large text files.
28+
# Pre-archive them immediately.
29+
pushd ${host}/$c
30+
tar cvfz OF.tgz open-flows.log groups.log
31+
rm -f open-flows.log groups.log
32+
popd
2633
done
2734

2835
for c in $(podman ps --format "{{.Names}}" --filter "name=ovn-central"); do

0 commit comments

Comments
 (0)