Skip to content

Commit d80d4df

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

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

openwisp-monitoring/files/monitoring.agent

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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)