Skip to content

Commit 7103595

Browse files
devkapilbansalKapil Bansal
authored andcommitted
Merge branch 'master' into issues/57-move-logger-call-in-subroutine
2 parents b9ed265 + 27c6fb4 commit 7103595

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

openwisp-monitoring/files/monitoring.agent

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ time_to_seconds() {
6666
|| { [ "${time%h}" -ge 1 ] 2>/dev/null && seconds=$((${time%h} * 3600)); } \
6767
|| { [ "${time%d}" -ge 1 ] 2>/dev/null && seconds=$((${time%d} * 86400)); }
6868

69-
echo $seconds
69+
echo "$seconds"
7070
unset seconds
7171
unset time
7272
}
@@ -100,7 +100,7 @@ collect_data() {
100100
until [ "$n" -ge 5 ]; do
101101
/usr/sbin/netjson-monitoring --dump "$MONITORED_INTERFACES" && break
102102

103-
[ "$n" -eq 5 ] && log -e -v "Collecting data failed!"
103+
[ "$n" -eq 4 ] && log -e -v "Collecting data failed!"
104104
n=$((n + 1))
105105
sleep 5
106106
done
@@ -201,6 +201,7 @@ send_data() {
201201
# send data
202202
response_code=$($CURL_COMMAND -H "Content-Type: application/json" -d "$data" "$url")
203203
if [ "$response_code" = "200" ]; then
204+
success=$((success + 1))
204205
log -i -v "Data sent successfully."
205206
# check if agent was already failing or not to avoid repeating log messages
206207
if [ "$FAILING" -eq "1" ]; then

0 commit comments

Comments
 (0)