From cdf272edb63e9bf460e8330b099c7bb2d8c4f182 Mon Sep 17 00:00:00 2001 From: tykayn Date: Sun, 29 Nov 2020 13:59:03 +0100 Subject: [PATCH 1/4] enlever la fonction show --- .idea/mobilizon.chapril.org-tools.iml | 8 --- .idea/modules.xml | 8 --- .idea/vcs.xml | 6 --- .idea/workspace.xml | 70 --------------------------- rapport_activite/rapport_activite.sh | 30 ++++-------- 5 files changed, 10 insertions(+), 112 deletions(-) delete mode 100644 .idea/mobilizon.chapril.org-tools.iml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/vcs.xml delete mode 100644 .idea/workspace.xml diff --git a/.idea/mobilizon.chapril.org-tools.iml b/.idea/mobilizon.chapril.org-tools.iml deleted file mode 100644 index c956989..0000000 --- a/.idea/mobilizon.chapril.org-tools.iml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 6f68488..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 245cfb3..0000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1605258558512 - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/rapport_activite/rapport_activite.sh b/rapport_activite/rapport_activite.sh index f843780..d98915b 100755 --- a/rapport_activite/rapport_activite.sh +++ b/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() { @@ -125,19 +117,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" + 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 "Nombre d'évènements passés" -# echo "Nombre d'évènements à venir" echo } From 764a38153a991c56f36b35cdeedbbfd67ee34b27 Mon Sep 17 00:00:00 2001 From: Christian Pierre MOMON Date: Sun, 29 Nov 2020 15:53:32 +0100 Subject: [PATCH 2/4] Renamed report activity cron for mobilizon.chapril.org. --- rapport_activite/mobilizonchaprilorg-rapport-activite.cron | 2 -- rapport_activite/mobilizonchaprilorg-rapportactivite.cron | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 rapport_activite/mobilizonchaprilorg-rapport-activite.cron create mode 100644 rapport_activite/mobilizonchaprilorg-rapportactivite.cron diff --git a/rapport_activite/mobilizonchaprilorg-rapport-activite.cron b/rapport_activite/mobilizonchaprilorg-rapport-activite.cron deleted file mode 100644 index fb8c288..0000000 --- a/rapport_activite/mobilizonchaprilorg-rapport-activite.cron +++ /dev/null @@ -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 diff --git a/rapport_activite/mobilizonchaprilorg-rapportactivite.cron b/rapport_activite/mobilizonchaprilorg-rapportactivite.cron new file mode 100644 index 0000000..edd30ac --- /dev/null +++ b/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 From 94376595c34ced19cef13a5b267ef92e32e7df23 Mon Sep 17 00:00:00 2001 From: Christian Pierre MOMON Date: Thu, 3 Dec 2020 16:35:25 +0100 Subject: [PATCH 3/4] Cleaned foo file and normalized check update file name. --- .../{check_version.sh => check_mobilizonchaprilorg_update} | 0 monitoring/mobilizonchaprilorg.cron | 1 - 2 files changed, 1 deletion(-) rename monitoring/{check_version.sh => check_mobilizonchaprilorg_update} (100%) delete mode 100644 monitoring/mobilizonchaprilorg.cron diff --git a/monitoring/check_version.sh b/monitoring/check_mobilizonchaprilorg_update similarity index 100% rename from monitoring/check_version.sh rename to monitoring/check_mobilizonchaprilorg_update diff --git a/monitoring/mobilizonchaprilorg.cron b/monitoring/mobilizonchaprilorg.cron deleted file mode 100644 index efd9224..0000000 --- a/monitoring/mobilizonchaprilorg.cron +++ /dev/null @@ -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 From c106750bed14440443ed7be408b9ecd6643dd889 Mon Sep 17 00:00:00 2001 From: Christian Pierre MOMON Date: Thu, 3 Dec 2020 17:44:27 +0100 Subject: [PATCH 4/4] Fixed resutl level of mobilizon check update script. --- monitoring/check_mobilizonchaprilorg_update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monitoring/check_mobilizonchaprilorg_update b/monitoring/check_mobilizonchaprilorg_update index 1b3e920..cefed31 100755 --- a/monitoring/check_mobilizonchaprilorg_update +++ b/monitoring/check_mobilizonchaprilorg_update @@ -33,7 +33,7 @@ else result=0 else echo "WARNING : new version available, current is $currentVersion, last is $lastVersion." - result=2 + result=1 fi fi exit $result