Remove stats that require log_level > warning in ejabberd.

This commit is contained in:
pitchum 2022-03-08 23:02:20 +01:00 committed by root
parent ffbc11c74c
commit ebda9e97df

View File

@ -22,15 +22,6 @@ main() {
echo "* Total disk usage: $(du -sh ${STORAGE_DIR} | awk '{print $1}')" echo "* Total disk usage: $(du -sh ${STORAGE_DIR} | awk '{print $1}')"
per_account_storage_usage per_account_storage_usage
DATE=$(get_last_month)
echo ""
echo "h2. ## Audio/Video Call usage:"
echo ""
echo "* Total calls: $(zgrep "$DATE" /var/log/ejabberd/ejabberd.log* | grep -i -e "Offering stun" | wc -l)"
echo "* Data relayed per protocol per call:"
echo "** UDP: avg $(get_avg_UDP_turn_relayed_data) MiB, max $(get_max_UDP_turn_relayed_data) MiB, total $(get_total_UDP_turn_relayed_data) MiB"
echo "** TCP: avg $(get_avg_TCP_turn_relayed_data) MiB, max $(get_max_TCP_turn_relayed_data) MiB, total $(get_total_TCP_turn_relayed_data) MiB"
echo "** TLS: avg $(get_avg_TLS_turn_relayed_data) MiB, max $(get_max_TLS_turn_relayed_data) MiB, total $(get_total_TLS_turn_relayed_data) MiB"
echo "" echo ""
echo "h2. ## XMPP/IRC Bridge (Biboumi) usage:" echo "h2. ## XMPP/IRC Bridge (Biboumi) usage:"
echo "" echo ""
@ -214,64 +205,4 @@ get_last_month() {
echo $yearMonth echo $yearMonth
} }
get_total_UDP_turn_relayed_data() {
n=$(zgrep "$DATE" /var/log/ejabberd/ejabberd.log* | grep -i -e "Relayed" | grep "UDP" | cut -d" " -f6-6 | paste -sd+ - | bc)
echo "scale=4; $n / 1024" | bc -l
}
get_total_TCP_turn_relayed_data() {
n=$(zgrep "$DATE" /var/log/ejabberd/ejabberd.log* | grep -i -e "Relayed" | grep "TCP" | cut -d" " -f6-6 | paste -sd+ - | bc)
echo "scale=4; $n / 1024" | bc -l
}
get_total_TLS_turn_relayed_data() {
n=$(zgrep "$DATE" /var/log/ejabberd/ejabberd.log* | grep -i -e "Relayed" | grep "TLS" | cut -d" " -f6-6 | paste -sd+ - | bc)
echo "scale=4; $n / 1024" | bc -l
}
get_max_UDP_turn_relayed_data() {
n=$(zgrep "$DATE" /var/log/ejabberd/ejabberd.log* | grep -i -e "Relayed" | grep "UDP" | cut -d" " -f6-6 | sort -g | tail -n 1)
echo "scale=4; $n / 1024" | bc -l
}
get_max_TCP_turn_relayed_data() {
n=$(zgrep "$DATE" /var/log/ejabberd/ejabberd.log* | grep -i -e "Relayed" | grep "TCP" | cut -d" " -f6-6 | sort -g | tail -n 1)
echo "scale=4; $n / 1024" | bc -l
}
get_max_TLS_turn_relayed_data() {
n=$(zgrep "$DATE" /var/log/ejabberd/ejabberd.log* | grep -i -e "Relayed" | grep "TLS" | cut -d" " -f6-6 | sort -g | tail -n 1)
echo "scale=4; $n / 1024" | bc -l
}
get_avg_UDP_turn_relayed_data() {
n=$(zgrep "$DATE" /var/log/ejabberd/ejabberd.log* | grep -i -e "Offering stun" | wc -l)
total=$(get_total_UDP_turn_relayed_data)
if [ $n -eq 0 ]; then
echo 0
else
echo "scale=2; $total / $n" | bc -l
fi
}
get_avg_TCP_turn_relayed_data() {
n=$(zgrep "$DATE" /var/log/ejabberd/ejabberd.log* | grep -i -e "Offering stun" | wc -l)
total=$(get_total_TCP_turn_relayed_data)
if [ $n -eq 0 ]; then
echo 0
else
echo "scale=2; $total / $n" | bc -l
fi
}
get_avg_TLS_turn_relayed_data() {
n=$(zgrep "$DATE" /var/log/ejabberd/ejabberd.log* | grep -i -e "Offering stun" | wc -l)
total=$(get_total_TLS_turn_relayed_data)
if [ $n -eq 0 ]; then
echo 0
else
echo "scale=2; $total / $n" | bc -l
fi
}
main main