Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Projets-INFO4
20-21
18
chirpstack-monitoring
Commits
e30e37a1
Commit
e30e37a1
authored
Apr 06, 2021
by
Antoine Blanquet
Browse files
cleaning all code, make console log clear. Ready to be pushed on gitlab uga
parent
33e5398b
Changes
6
Hide whitespace changes
Inline
Side-by-side
reports/generate_reports.sh
View file @
e30e37a1
...
...
@@ -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
reports/generate_sparkline_image.js
View file @
e30e37a1
...
...
@@ -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
"
)
}
});
reports/get_devices.sh
View file @
e30e37a1
...
...
@@ -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
...
...
reports/get_gateways.sh
View file @
e30e37a1
...
...
@@ -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 g
ateway
$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
reports/get_jwt.sh
View file @
e30e37a1
...
...
@@ -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"
...
...
reports/sendmail_reports.sh
View file @
e30e37a1
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment