Page MenuHomePhabricator

wait_for_galera_issue.sh

Authored By
dcaro
Jun 15 2022, 4:21 PM
Size
682 B
Referenced Files
None
Subscribers
None

wait_for_galera_issue.sh

#!/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

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
9524260
Default Alt Text
wait_for_galera_issue.sh (682 B)

Event Timeline