Corrected A/V call count
This commit is contained in:
parent
3667c59e4f
commit
f85b69ea31
|
@ -21,7 +21,7 @@ if test -n ${BASH_VERSION:-''} ; then
|
||||||
R=$RANDOM
|
R=$RANDOM
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
for n in `od -A n -t u2 -N 48 /dev/urandom`; do RL="$RL$n "; done
|
for n in `od -A n -t u2 -N 64 /dev/urandom`; do RL="$RL$n "; done
|
||||||
get_random ()
|
get_random ()
|
||||||
{
|
{
|
||||||
R=${RL%% *}
|
R=${RL%% *}
|
||||||
|
|
|
@ -27,7 +27,7 @@ main() {
|
||||||
echo "h2. ## Audio/Video Call usage:"
|
echo "h2. ## Audio/Video Call usage:"
|
||||||
# Dans la config actuelle de logrotate, le log du mois dernier est stocké en tete clair, et tous les autres sont compressés par gzip. Un cat ne sortira de texte lisible que pour les fichiers en clair soit forcément celui du mois précédent
|
# Dans la config actuelle de logrotate, le log du mois dernier est stocké en tete clair, et tous les autres sont compressés par gzip. Un cat ne sortira de texte lisible que pour les fichiers en clair soit forcément celui du mois précédent
|
||||||
echo ""
|
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 "* 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 "** 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 "** 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"
|
||||||
|
@ -112,7 +112,7 @@ get_last_month() {
|
||||||
}
|
}
|
||||||
|
|
||||||
get_total_UDP_turn_relayed_data() {
|
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)
|
n=$(zgrep "$DATE" /var/log/ejabberd/ejabberd.log* | grep -i -e "Relayed" | grep "UDP" | cut -d" " -f6-6 | paste -sd+ - | bc)
|
||||||
if [ -z $n ]; then
|
if [ -z $n ]; then
|
||||||
echo 0
|
echo 0
|
||||||
else
|
else
|
||||||
|
@ -121,7 +121,7 @@ get_total_UDP_turn_relayed_data() {
|
||||||
}
|
}
|
||||||
|
|
||||||
get_total_TCP_turn_relayed_data() {
|
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)
|
n=$(zgrep "$DATE" /var/log/ejabberd/ejabberd.log* | grep -i -e "Relayed" | grep "TCP" | cut -d" " -f6-6 | paste -sd+ - | bc)
|
||||||
if [ -z $n ]; then
|
if [ -z $n ]; then
|
||||||
echo 0
|
echo 0
|
||||||
else
|
else
|
||||||
|
@ -130,7 +130,7 @@ get_total_TCP_turn_relayed_data() {
|
||||||
}
|
}
|
||||||
|
|
||||||
get_total_TLS_turn_relayed_data() {
|
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)
|
n=$(zgrep "$DATE" /var/log/ejabberd/ejabberd.log* | grep -i -e "Relayed" | grep "TLS" | cut -d" " -f6-6 | paste -sd+ - | bc)
|
||||||
if [ -z $n ]; then
|
if [ -z $n ]; then
|
||||||
echo 0
|
echo 0
|
||||||
else
|
else
|
||||||
|
@ -139,7 +139,7 @@ get_total_TLS_turn_relayed_data() {
|
||||||
}
|
}
|
||||||
|
|
||||||
get_max_UDP_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 | 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
|
if [ -z $n ]; then
|
||||||
echo 0
|
echo 0
|
||||||
else
|
else
|
||||||
|
@ -148,7 +148,7 @@ get_max_UDP_turn_relayed_data() {
|
||||||
}
|
}
|
||||||
|
|
||||||
get_max_TCP_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 | 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
|
if [ -z $n ]; then
|
||||||
echo 0
|
echo 0
|
||||||
else
|
else
|
||||||
|
@ -157,7 +157,7 @@ get_max_TCP_turn_relayed_data() {
|
||||||
}
|
}
|
||||||
|
|
||||||
get_max_TLS_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 | 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
|
if [ -z $n ]; then
|
||||||
echo 0
|
echo 0
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue