Compare commits
No commits in common. "dd3a70f5482862ffb83a0334178643bdbabcc619" and "7dac59df10c7a51284689f6dd422f17f2d2cf3f9" have entirely different histories.
dd3a70f548
...
7dac59df10
@ -70,9 +70,9 @@ INTRUS()
|
||||
R=$(($R % 100))
|
||||
|
||||
if [[ $R -lt 50 ]]; then
|
||||
echo "Tapez ce nombre en enlevant les ${DIGIT[$INTRUS]} | $NEWINPUT"
|
||||
echo "Tapez | $NEWINPUT |en supprimant les ${DIGIT[$INTRUS]}"
|
||||
else
|
||||
echo "Saisissez ce nombre sans les ${DIGIT[$INTRUS]} | $NEWINPUT"
|
||||
echo "Saisissez | $NEWINPUT |en enlevant les ${DIGIT[$INTRUS]}"
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -70,9 +70,9 @@ INTRUS()
|
||||
R=$(($R % 100))
|
||||
|
||||
if [[ $R -lt 50 ]]; then
|
||||
echo "Tapez ce nombre en enlevant les ${DIGIT[$INTRUS]} | $NEWINPUT"
|
||||
echo "Tapez | $NEWINPUT |en supprimant les ${DIGIT[$INTRUS]}"
|
||||
else
|
||||
echo "Saisissez ce nombre sans les ${DIGIT[$INTRUS]} | $NEWINPUT"
|
||||
echo "Saisissez | $NEWINPUT |en enlevant les ${DIGIT[$INTRUS]}"
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -26,20 +26,11 @@ main() {
|
||||
echo ""
|
||||
echo "h2. ## Audio/Video Call usage:"
|
||||
echo ""
|
||||
echo "* Number of calls relayed: $(zgrep "$DATE" /var/log/ejabberd/ejabberd.log* | grep -i -e "Offering stun" | wc -l)"
|
||||
echo "* Number of calls relayed: $(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) KiB, max $(get_max_UDP_turn_relayed_data) KiB, total $(get_total_UDP_turn_relayed_data) KiB"
|
||||
echo "** TCP: avg $(get_avg_TCP_turn_relayed_data) KiB, max $(get_max_TCP_turn_relayed_data) KiB, total $(get_total_TCP_turn_relayed_data) KiB"
|
||||
echo "** TLS: avg $(get_avg_TLS_turn_relayed_data) KiB, max $(get_max_TLS_turn_relayed_data) KiB, total $(get_total_TLS_turn_relayed_data) KiB"
|
||||
echo ""
|
||||
echo "h2. ## XMPP/IRC Bridge (Biboumi) usage:"
|
||||
echo ""
|
||||
echo "* Total users: $(count_biboumi_users)"
|
||||
echo "** Active: $(count_biboumi_active_users '1 MONTH')"
|
||||
echo "** Inactive: $(count_biboumi_inactive_users '1 MONTH')"
|
||||
echo "* Total messages stored (MAM): $(count_biboumi_archived_messages)"
|
||||
echo "* Total channels active: $(count_biboumi_active_chan)"
|
||||
echo "** through $(count_biboumi_active_servers) IRC server(s)"
|
||||
}
|
||||
|
||||
get_hard_quota() {
|
||||
@ -99,64 +90,7 @@ count_removable_accounts() {
|
||||
}
|
||||
|
||||
count_archived_messages() {
|
||||
sudo -Hiu postgres psql biboumi -c "select count(*) from archive where peer not like 'irc%' and username not in ('r.giskard', 'lisa.simpson', 'bart.simpson')" -t | grep -v '^$' | awk '{print $1}'
|
||||
}
|
||||
|
||||
count_biboumi_users() {
|
||||
# Accounts inactive *and* who never read the welcome message.
|
||||
sql="select count(distinct owner_)
|
||||
from muclogline_"
|
||||
|
||||
sudo -Hiu postgres psql biboumi -c "${sql}" -t | grep -v '^$' | awk '{print $1}'
|
||||
}
|
||||
|
||||
count_biboumi_active_users() {
|
||||
# Accounts inactive *and* who never read the welcome message.
|
||||
since=${1:-'1 MONTH'}
|
||||
sql="select count(distinct owner_)
|
||||
from muclogline_
|
||||
where to_timestamp(date_) > current_timestamp - interval '${since}'"
|
||||
|
||||
sudo -Hiu postgres psql biboumi -c "${sql}" -t | grep -v '^$' | awk '{print $1}'
|
||||
}
|
||||
|
||||
count_biboumi_inactive_users() {
|
||||
# Accounts inactive *and* who never read the welcome message.
|
||||
since=${1:-'1 MONTH'}
|
||||
sql="select count(distinct owner_)
|
||||
from muclogline_
|
||||
where to_timestamp(date_) < current_timestamp - interval '${since}'"
|
||||
|
||||
sudo -Hiu postgres psql biboumi -c "${sql}" -t | grep -v '^$' | awk '{print $1}'
|
||||
}
|
||||
|
||||
count_biboumi_archived_messages() {
|
||||
# Accounts inactive *and* who never read the welcome message.
|
||||
since=${1:-'1 MONTH'}
|
||||
sql="select count(distinct body_)
|
||||
from muclogline_"
|
||||
|
||||
sudo -Hiu postgres psql biboumi -c "${sql}" -t | grep -v '^$' | awk '{print $1}'
|
||||
}
|
||||
|
||||
count_biboumi_active_servers() {
|
||||
# Accounts inactive *and* who never read the welcome message.
|
||||
since=${1:-'1 MONTH'}
|
||||
sql="select count(distinct ircservername_)
|
||||
from muclogline_
|
||||
where to_timestamp(date_) > current_timestamp - interval '${since}'"
|
||||
|
||||
sudo -Hiu postgres psql biboumi -c "${sql}" -t | grep -v '^$' | awk '{print $1}'
|
||||
}
|
||||
|
||||
count_biboumi_active_chan() {
|
||||
# Accounts inactive *and* who never read the welcome message.
|
||||
since=${1:-'1 MONTH'}
|
||||
sql="select count(distinct ircchanname_)
|
||||
from muclogline_
|
||||
where to_timestamp(date_) > current_timestamp - interval '${since}'"
|
||||
|
||||
sudo -Hiu postgres psql biboumi -c "${sql}" -t | grep -v '^$' | awk '{print $1}'
|
||||
psql -U ejabberd -h localhost ejabberd -c "select count(*) from archive where peer not like 'irc%' and username not in ('r.giskard', 'lisa.simpson', 'bart.simpson')" -t | grep -v '^$' | awk '{print $1}'
|
||||
}
|
||||
|
||||
get_last_month() {
|
||||
@ -173,7 +107,7 @@ get_last_month() {
|
||||
year="$(($(date +%Y)-1))"
|
||||
yearMonth="$year-$precedingMonth"
|
||||
fi
|
||||
echo $yearMonth
|
||||
echo "$year-$precedingMonth"
|
||||
}
|
||||
|
||||
get_total_UDP_turn_relayed_data() {
|
||||
@ -204,7 +138,7 @@ get_total_TLS_turn_relayed_data() {
|
||||
}
|
||||
|
||||
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)
|
||||
n=$(zgrep "$DATE" /var/log/ejabberd/ejabberd.log* | grep -i -e "Relayed" | grep "UDP" | cut -d" " -f6-6 | sort | tail -n 1)
|
||||
if [ -z $n ]; then
|
||||
echo 0
|
||||
else
|
||||
@ -213,7 +147,7 @@ get_max_UDP_turn_relayed_data() {
|
||||
}
|
||||
|
||||
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)
|
||||
n=$(zgrep "$DATE" /var/log/ejabberd/ejabberd.log* | grep -i -e "Relayed" | grep "TCP" | cut -d" " -f6-6 | sort | tail -n 1)
|
||||
if [ -z $n ]; then
|
||||
echo 0
|
||||
else
|
||||
@ -222,7 +156,7 @@ get_max_TCP_turn_relayed_data() {
|
||||
}
|
||||
|
||||
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)
|
||||
n=$(zgrep "$DATE" /var/log/ejabberd/ejabberd.log* | grep -i -e "Relayed" | grep "TLS" | cut -d" " -f6-6 | sort | tail -n 1)
|
||||
if [ -z $n ]; then
|
||||
echo 0
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user