Merge branch 'master' of ssh://forge.april.org:222/Chapril/mobilizon.chapril.org-tools

This commit is contained in:
Tykayn 2020-12-08 09:51:04 +01:00 committed by tykayn
commit d51311a0c5
5 changed files with 13 additions and 22 deletions

View File

@ -34,7 +34,7 @@ else
result=0
else
echo "WARNING : new version available, current is $currentVersion, last is $lastVersion."
result=2
result=1
fi
fi
exit $result

View File

@ -1 +0,0 @@
5 0 1 * * root /srv/mobilizon.chapril.org/tools/rapport_activite/rapport_activite.sh -p >> /srv/mobilizon.chapril.org/Exploitation/rapport_mobilizon.log 2>&1

View File

@ -1,2 +0,0 @@
#
5 0 1 * * root /srv/mobilizon.chapril.org/tools/rapport_activite/update_redmine_ticket.sh > /var/log/mobilizonchaprilorg-cron.log 2>&1

View File

@ -0,0 +1,2 @@
#
5 0 1 * * root /srv/mobilizon.chapril.org/tools/rapport_activite/update_redmine_ticket.sh > /var/log/mobilizon.chapril.org/rapportactivite-cron.log 2>&1

View File

@ -83,14 +83,6 @@ generateHTTPReport()
echo
}
# display the value of a key in the json fetched with curl
function show
{
# to navigate to sub keys like data.statistics.my_key , we must use multiple -e extract options
local value=$(echo "$json" | jshon -e "data" -e "statistics" -e $1 -u)
printf "$1=$value\n"
}
#
generateSpecificReport()
{
@ -117,16 +109,16 @@ generateSpecificReport()
echo "Nombre total d'ip utilisatrices du service = $((ipv4UserCount+ipv6UserCount))"
echo "Nombre total d'erreurs = $errorsCount"
echo "Nombre d'évènements = $(echo "$json" | jshon -e "data" -e "statistics" -e "numberOfEvents" -u)"
echo "Nombre d'évènements locaux = $(echo "$json" | jshon -e "data" -e "statistics" -e "numberOfLocalEvents" -u)"
echo "Nombre de groupes = $(echo "$json" | jshon -e "data" -e "statistics" -e "numberOfGroups" -u)"
echo "Nombre de groupes locaux = $(echo "$json" | jshon -e "data" -e "statistics" -e "numberOfLocalGroups" -u)"
echo "Nombre de commentaires = $(echo "$json" | jshon -e "data" -e "statistics" -e "numberOfComments" -u)"
echo "Nombre de commentaires locaux = $(echo "$json" | jshon -e "data" -e "statistics" -e "numberOfLocalComments" -u)"
echo "Nombre d'instances abonnées = $(echo "$json" | jshon -e "data" -e "statistics" -e "numberOfInstanceFollowers" -u)"
echo "Nombre d'instances suivies = $(echo "$json" | jshon -e "data" -e "statistics" -e "numberOfInstanceFollowings" -u)"
echo "Nombre d'utilisateurices selon l'api = $(echo "$json" | jshon -e "data" -e "statistics" -e "numberOfUsers" -u)"
show "numberOfEvents"
show "numberOfLocalEvents"
show "numberOfGroups"
show "numberOfLocalGroups"
show "numberOfComments"
show "numberOfLocalComments"
show "numberOfInstanceFollowers"
show "numberOfInstanceFollowings"
show "numberOfUsers"
echo
}