-
Notifications
You must be signed in to change notification settings - Fork 14
/
cerostats.sh
executable file
·77 lines (60 loc) · 2.38 KB
/
cerostats.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#! /bin/sh
# A collection of diagnostic commands to run when troubles arise.
# Based on Sebastian Moeller's original from:
# https://lists.bufferbloat.net/pipermail/cerowrt-devel/2014-April/002871.html
#
# The default script collects stats for the first 2.4GHz interface.
# Change for your situation.
#
# - phy0 - 2.4GHz radio
# - sw00 - First 2.4GHz wireless interface
# - /tmp/cerostats_output.txt - output file for stats
radio=phy0
wlan_if=sw00
out_fqn=/tmp/cerostats_output.txt
echo -e "[date]" > ${out_fqn}
date >> ${out_fqn}
echo -e "\n" >> ${out_fqn}
echo -e "[uname -a]" >> ${out_fqn}
echo $( uname -a ) >> ${out_fqn}
echo -e "\n" >> ${out_fqn}
echo -e "[uptime]" >> ${out_fqn}
echo $( uptime ) >> ${out_fqn}
echo -e "\n" >> ${out_fqn}
echo -e "[ifconfig]" >> ${out_fqn}
ifconfig >> ${out_fqn}
echo -e "\n" >> ${out_fqn}
echo -e "[top]" >> ${out_fqn}
top -b | head -n 20 >> ${out_fqn}
echo -e "\n" >> ${out_fqn}
echo -e "[tc -s qdisc show dev ${wlan_if}]" >> ${out_fqn}
tc -s qdisc show dev ${wlan_if} >> ${out_fqn}
echo -e "\n" >> ${out_fqn}
echo -e "[iw dev ${wlan_if} station dump]" >> ${out_fqn}
iw dev ${wlan_if} station dump >> ${out_fqn}
echo -e "\n" >> ${out_fqn}
echo -e "[cat /sys/kernel/debug/ieee80211/${radio}/ath9k/ani]" >> ${out_fqn}
cat /sys/kernel/debug/ieee80211/${radio}/ath9k/ani >> ${out_fqn}
echo -e "" >> ${out_fqn}
echo -e "[cat /sys/kernel/debug/ieee80211/${radio}/ath9k/interrupt]" >> ${out_fqn}
cat /sys/kernel/debug/ieee80211/${radio}/ath9k/interrupt >> ${out_fqn}
echo -e "" >> ${out_fqn}
echo -e "[cat /sys/kernel/debug/ieee80211/${radio}/ath9k/queues]" >> ${out_fqn}
cat /sys/kernel/debug/ieee80211/${radio}/ath9k/queues >> ${out_fqn}
echo -e "" >> ${out_fqn}
echo -e "[cat /sys/kernel/debug/ieee80211/${radio}/ath9k/xmit]" >> ${out_fqn}
cat /sys/kernel/debug/ieee80211/${radio}/ath9k/xmit >> ${out_fqn}
echo -e "" >> ${out_fqn}
echo -e "[cat /sys/kernel/debug/ieee80211/${radio}/ath9k/recv]" >> ${out_fqn}
cat /sys/kernel/debug/ieee80211/${radio}/ath9k/recv >> ${out_fqn}
echo -e "" >> ${out_fqn}
echo -e "[cat /sys/kernel/debug/ieee80211/${radio}/ath9k/reset]" >> ${out_fqn}
cat /sys/kernel/debug/ieee80211/${radio}/ath9k/reset >> ${out_fqn}
echo -e "" >> ${out_fqn}
echo -e "[logread]" >> ${out_fqn}
logread >> ${out_fqn}
echo -e "\n" >> ${out_fqn}
echo -e "[dmesg]" >> ${out_fqn}
dmesg >> ${out_fqn}
echo -e "" >> ${out_fqn}
echo "Done... Stats written to ${out_fqn} (${0})"