Skip to content
GitLab
Menu
Projects
Groups
Snippets
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
332ff98c
Commit
332ff98c
authored
Apr 05, 2021
by
Antoine Blanquet
Browse files
Passive Active Bug Fixed if file doesn't exisst at start (with Keving Y)
parent
af917337
Changes
2
Hide whitespace changes
Inline
Side-by-side
reports/get_id_devices_change.sh
View file @
332ff98c
...
...
@@ -46,26 +46,27 @@ do
done
#On stock les ids des devices d'hier
ids_2
=
$(
jq
--raw-output
".result[] | .id"
${
DATA_DEV_FOLDER
}
.last_devices_states.json
)
id_2
=()
i
=
0
for
ID
in
$ids_2
do
id_2[
$i
]=
$ID
i
=
$((
i+1
))
done
#On stock les states des devices d'hier
full_state
=
$(
jq
--raw-output
".result[] | .lastState"
${
DATA_DEV_FOLDER
}
.last_devices_states.json
)
states_2
=()
j
=
0
for
s
in
$full_state
do
state_2[
$j
]=
$s
j
=
$((
j+1
))
done
if
[
-f
"
${
DATA_DEV_FOLDER
}
.last_devices_states.json"
]
;
then
#On stock les ids des devices d'hier
ids_2
=
$(
jq
--raw-output
".result[] | .id"
${
DATA_DEV_FOLDER
}
.last_devices_states.json
)
id_2
=()
i
=
0
for
ID
in
$ids_2
do
id_2[
$i
]=
$ID
i
=
$((
i+1
))
done
#On stock les states des devices d'hier
full_state
=
$(
jq
--raw-output
".result[] | .lastState"
${
DATA_DEV_FOLDER
}
.last_devices_states.json
)
states_2
=()
j
=
0
for
s
in
$full_state
do
state_2[
$j
]=
$s
j
=
$((
j+1
))
done
fi
#On compare les states des devices d'aujourd'hui et hier
for
((
i
=
0
;
i<
${#
id
[@]
}
;
i++
))
...
...
reports/get_id_gateways_change.sh
View file @
332ff98c
...
...
@@ -45,26 +45,27 @@ do
fi
done
#We store yesterday gateways ids
ids_2
=
$(
jq
--raw-output
".result[] | .id"
${
DATA_GAT_FOLDER
}
.last_gateways_states.json
)
id_2
=()
i
=
0
for
ID
in
$ids_2
do
id_2[
$i
]=
$ID
i
=
$((
i+1
))
done
#We store yesterday gateways states
full_state
=
$(
jq
--raw-output
".result[] | .lastState"
${
DATA_GAT_FOLDER
}
.last_gateways_states.json
)
states_2
=()
j
=
0
for
s
in
$full_state
do
state_2[
$j
]=
$s
j
=
$((
j+1
))
done
if
[
-f
"
${
DATA_GAT_FOLDER
}
.last_gateways_states.json"
]
;
then
#We store yesterday gateways ids
ids_2
=
$(
jq
--raw-output
".result[] | .id"
${
DATA_GAT_FOLDER
}
.last_gateways_states.json
)
id_2
=()
i
=
0
for
ID
in
$ids_2
do
id_2[
$i
]=
$ID
i
=
$((
i+1
))
done
#We store yesterday gateways states
full_state
=
$(
jq
--raw-output
".result[] | .lastState"
${
DATA_GAT_FOLDER
}
.last_gateways_states.json
)
states_2
=()
j
=
0
for
s
in
$full_state
do
state_2[
$j
]=
$s
j
=
$((
j+1
))
done
fi
#We compare today and yesterday gateways states
for
((
i
=
0
;
i<
${#
id
[@]
}
;
i++
))
...
...
Write
Preview
Supports
Markdown
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