Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions openwisp-monitoring/files/monitoring.agent
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,7 @@ send_data() {
fi
filename="$TMP_DIR/$filename"
# check if the data file exist
if [ -f "$filename" ]; then
data=$(cat "$filename")
else
if ! [ -f "$filename" ]; then
[ "$VERBOSE_MODE" -eq "1" ] && logger -s "data file $filename not found." \
-p daemon.info
continue
Expand All @@ -176,7 +174,7 @@ send_data() {
break
fi
# send data
response_code=$($CURL_COMMAND -H "Content-Type: application/json" -d "$data" "$url")
response_code=$($CURL_COMMAND -H "Content-Type: application/json" -d "@$filename" "$url")
if [ "$response_code" = "200" ]; then
success=$((success + 1))
if [ "$VERBOSE_MODE" -eq "1" ]; then
Expand Down