File tree Expand file tree Collapse file tree
openwisp-monitoring/files Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments