23
2
Fork 0

Compare commits

..

No commits in common. "a5e45d737ecde183d95c0fafec92bfff09051a03" and "ed22cb914786dba5e31ef5ca863ee3cd22013c23" have entirely different histories.

2 changed files with 8 additions and 7 deletions

View File

@ -1,7 +1,7 @@
#! /bin/bash
TEMPLATE=/srv/xmpp.chapril.org/tools/nodeinfo2/template-x-nodeinfo2.json
TARGET_FILE=/srv/xmpp.chapril.org/experimental/x-nodeinfo2.json
TARGET_FILE=/srv/x-nodeinfo2.json
main() {
cat "${TEMPLATE}" \
@ -45,9 +45,11 @@ per_account_storage_usage() {
user_activity() {
days_back=${1:-30}
sql="select count(distinct l.username)
from last l
where to_timestamp(cast(l.seconds as int)) > current_timestamp - interval '${days_back} days'
sql="select count(distinct username)
from archive
where peer not like 'irc%'
and kind = 'chat'
and created_at > current_timestamp - interval '${days_back} days'
and username not in ('r.giskard', 'lisa.simpson', 'bart.simpson')"
psql -U ejabberd -h localhost ejabberd -c "${sql}" -t | grep -v '^$' | awk '{print $1}'

View File

@ -1,7 +1,5 @@
#! /bin/bash
STORAGE_DIR="/var/www/xmpp.chapril.org/upload/"
main() {
echo "h2. ## Global info"
echo ""
@ -13,7 +11,7 @@ main() {
echo "h2. ## HTTP upload storage:"
echo ""
echo "* User quota: $(get_hard_quota)M"
echo "* Total disk usage: $(du -sh ${STORAGE_DIR} | awk '{print $1}')"
echo "* Total disk usage: $(du -sh /srv/ejabberd/chapril.org/upload/ | awk '{print $1}')"
per_account_storage_usage
# echo "s2s outgoing connections: $(sudo -u ejabberd ejabberdctl incoming_s2s_number)"
# echo "s2s incoming connections: $(sudo -u ejabberd ejabberdctl outgoing_s2s_number)"
@ -24,6 +22,7 @@ get_hard_quota() {
}
per_account_storage_usage() {
STORAGE_DIR="/srv/ejabberd/chapril.org/upload/"
# TODO Directories to ignore because they are used for tests accounts (bart and lisa simpsons)
IGNORE_DIRS="35eae3ddc83d72e4d3fad3160a400db688d7d936 9be859c77649f33d207cbe0d74a126b2fd31cb33"