15
0
Fork 0
Browse Source

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

master
Tykayn 1 year ago committed by tykayn
parent
commit
d51311a0c5
  1. 2
      monitoring/check_mobilizonchaprilorg_update
  2. 1
      monitoring/mobilizonchaprilorg.cron
  3. 2
      rapport_activite/mobilizonchaprilorg-rapport-activite.cron
  4. 2
      rapport_activite/mobilizonchaprilorg-rapportactivite.cron
  5. 30
      rapport_activite/rapport_activite.sh

2
monitoring/check_version.sh → monitoring/check_mobilizonchaprilorg_update

@ -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

1
monitoring/mobilizonchaprilorg.cron

@ -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

2
rapport_activite/mobilizonchaprilorg-rapport-activite.cron

@ -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

2
rapport_activite/mobilizonchaprilorg-rapportactivite.cron

@ -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

30
rapport_activite/rapport_activite.sh

@ -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()
{
@ -116,17 +108,17 @@ generateSpecificReport()
echo "Nombre d'ipv6 utilisatrices du service = $ipv6UserCount"
echo "Nombre total d'ip utilisatrices du service = $((ipv4UserCount+ipv6UserCount))"
echo "Nombre total d'erreurs = $errorsCount"
show "numberOfEvents"
show "numberOfLocalEvents"
show "numberOfGroups"
show "numberOfLocalGroups"
show "numberOfComments"
show "numberOfLocalComments"
show "numberOfInstanceFollowers"
show "numberOfInstanceFollowings"
show "numberOfUsers"
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)"
echo
}

Loading…
Cancel
Save