Page MenuHomePhabricator
Paste P29846

wait_for_galera_issue.sh
ActivePublic

Authored by dcaro on Jun 15 2022, 4:21 PM.
Tags
None
Referenced Files
F35244274: wait_for_galera_issue.sh
Jun 15 2022, 4:21 PM
Subscribers
None
#!/bin/bash
# dcaro trying to catch the haproxy flap
old_logs=$(journalctl -u haproxy -n1 | tail -n1)
new_logs=$old_logs
count=3
gotten=0
tcpdump \
-Z root \
-i eno1 \
-w /tmp/galera_testing.pcap \
-G 120 \
host cloudcontrol1003.wikimedia.org or host cloudcontrol1004.wikimedia.org \
&
while [[ $gotten -lt $count ]]; do
while [[ "$old_logs" == "$new_logs" ]]; do
sleep 1
new_logs=$(journalctl -u haproxy -n1 | tail -n1)
done
echo "Got one at $(date)"
cp /tmp/galera_testing.pcap /tmp/galera_testing.pcap.$(date +%H%M%S_%d%m%y)
gotten=$((gotten+1))
done
echo "stopping the tcpdump process, we got a hit"
pkill tcpdump