Compare commits
3 Commits
ed22cb9147
...
a5e45d737e
Author | SHA1 | Date |
---|---|---|
pitchum | a5e45d737e | |
pitchum | 5609860818 | |
pitchum | d39a247454 |
|
@ -1,7 +1,7 @@
|
|||
#! /bin/bash
|
||||
|
||||
TEMPLATE=/srv/xmpp.chapril.org/tools/nodeinfo2/template-x-nodeinfo2.json
|
||||
TARGET_FILE=/srv/x-nodeinfo2.json
|
||||
TARGET_FILE=/srv/xmpp.chapril.org/experimental/x-nodeinfo2.json
|
||||
|
||||
main() {
|
||||
cat "${TEMPLATE}" \
|
||||
|
@ -45,11 +45,9 @@ per_account_storage_usage() {
|
|||
|
||||
user_activity() {
|
||||
days_back=${1:-30}
|
||||
sql="select count(distinct username)
|
||||
from archive
|
||||
where peer not like 'irc%'
|
||||
and kind = 'chat'
|
||||
and created_at > current_timestamp - interval '${days_back} days'
|
||||
sql="select count(distinct l.username)
|
||||
from last l
|
||||
where to_timestamp(cast(l.seconds as int)) > 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}'
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#! /bin/bash
|
||||
|
||||
STORAGE_DIR="/var/www/xmpp.chapril.org/upload/"
|
||||
|
||||
main() {
|
||||
echo "h2. ## Global info"
|
||||
echo ""
|
||||
|
@ -11,7 +13,7 @@ main() {
|
|||
echo "h2. ## HTTP upload storage:"
|
||||
echo ""
|
||||
echo "* User quota: $(get_hard_quota)M"
|
||||
echo "* Total disk usage: $(du -sh /srv/ejabberd/chapril.org/upload/ | awk '{print $1}')"
|
||||
echo "* Total disk usage: $(du -sh ${STORAGE_DIR} | 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)"
|
||||
|
@ -22,7 +24,6 @@ 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"
|
||||
|
||||
|
|
Loading…
Reference in New Issue