Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit e30e37a1 authored by Antoine Blanquet's avatar Antoine Blanquet
Browse files

cleaning all code, make console log clear. Ready to be pushed on gitlab uga

parent 33e5398b
......@@ -15,10 +15,12 @@ DATA_CONFIG_FOLDER="data/configuration/"
USERNAME=$(jq --raw-output ".username" ${DATA_CONFIG_FOLDER}.credentials.json)
PASSWORD=$(jq --raw-output ".password" ${DATA_CONFIG_FOLDER}.credentials.json)
echo "-------- get_jwt.sh --------"
JWT=$(./get_jwt.sh $USERNAME $PASSWORD)
echo "-------- get_organizations.sh --------"
./get_organizations.sh $JWT
echo "-------- get_gateways.sh --------"
./get_gateways.sh $JWT
echo "-------- get_devices.sh --------"
./get_devices.sh $JWT
# TODO send reports by email
......@@ -15,9 +15,9 @@ var link = "file://" + process.cwd() + "/data/generated_files/.gateways.html"
webshot(link,
'data/images/sparkline_report.png', function(err) {
if (!err) {
console.log("Screenshot taken!")
console.log("\t Screenshot taken!")
} else {
console.log("Bug when generating screeenshot with Sparkline")
console.log("\t Bug when generating screeenshot with Sparkline")
}
});
......@@ -102,8 +102,9 @@ sed -i "/"totalCount"/c $replacement" ${DATA_DEV_FOLDER}.devices.json
echo "generate devices.html"
./generate_devices_report.sh $TODAY
echo "comparing devices states Passives and Actives of the report with the last report."
echo -e "\t in green : devices who was passive became active"
echo -e "\t in red : devices who was active became passive"
./get_id_devices_change.sh
......
......@@ -71,7 +71,7 @@ GATEWAYS=$(jq --raw-output ".result | sort_by(.lastSeenAt, .id) | reverse [] | (
GATEWAYS_LEN=$(jq --raw-output ".totalCount" ${DATA_GAT_FOLDER}.gateways.json)
for g in $GATEWAYS
do
echo "get details for $g"
echo "get details for gateway $g (basic & stats informations)"
./get_gateway.sh $TOKEN $g
./get_gateway_stats.sh $TOKEN $g $TODAY
done
......@@ -79,7 +79,9 @@ done
echo "generate html (2 copies : one with sparkline and one without sparkline)"
./generate_gateways_report.sh $GATEWAYS_LEN $GATEWAYS $TODAY
echo "Passive Active Check"
echo "comparing gateways states Passives and Actives of the report with the last report."
echo -e "\t in green : gateways who was passive became active"
echo -e "\t in red : gateways who was active became passive"
./get_id_gateways_change.sh ".gateways.html"
./get_id_gateways_change.sh ".gateways_without_sparkline.html"
......@@ -97,4 +99,5 @@ if [ `npm list --silent | grep -c $package` -eq 0 ]; then
fi
# Generate an image of the page html with sparkline
echo "Generate an image of the page html with sparkline"
node generate_sparkline_image.js
......@@ -48,7 +48,6 @@ DATA_CONFIG_FOLDER="data/configuration/"
# Doc
URL_SWAGGER=${URL}/swagger/api.swagger.json
# Operations
# Operations
#CURL="curl --verbose"
CURL="curl -s --insecure"
......
......@@ -15,7 +15,7 @@
# crontab entry
# TODO /bin/bash
# ./decompose_gateways_sparkline.sh
echo "-------- sendmail_reports.sh--------"
# DATA REPOSITORY
DATA_CONFIG_FOLDER="data/configuration/"
......@@ -62,4 +62,6 @@ else
echo ""
cat $IMAGE_LOC | base64
) | mail -t
fi
\ No newline at end of file
fi
echo "success sending emails to $TO"
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment