diff --git a/CHANGELOG.md b/CHANGELOG.md index fed4e13..ad5255a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,11 @@ # Changelog ## v3.0.10 -Updated on 2025-Dec-07 +Updated on 2025-Dec-09 * FIXED: Bug fix in a CLI menu function to get the full value of notification parameters from the configuration file. * FIXED: Bug fix in a WebUI JS function to get the full value of notification parameters from the configuration file. +* FIXED: Added new "InfluxDB Organization" parameter that's required to send InfluxDB notifications. +* FIXED: Modified the curl command call sending data to InfluxDB so that it conforms to new API requirements. * FIXED: Modified WebUI text message to show default interval of 5 minutes. Functionality was correct. This is just a correction to the text string. ## v3.0.9 diff --git a/connmon.sh b/connmon.sh index cda7e4e..e50d8be 100644 --- a/connmon.sh +++ b/connmon.sh @@ -37,7 +37,7 @@ ### Start of script variables ### readonly SCRIPT_NAME="connmon" readonly SCRIPT_VERSION="v3.0.10" -readonly SCRIPT_VERSTAG="25120912" +readonly SCRIPT_VERSTAG="25120920" SCRIPT_BRANCH="develop" SCRIPT_REPO="https://raw.githubusercontent.com/AMTM-OSR/$SCRIPT_NAME/$SCRIPT_BRANCH" readonly SCRIPT_DIR="/jffs/addons/$SCRIPT_NAME.d" @@ -3483,7 +3483,7 @@ SendHealthcheckPing() ##----------------------------------------## SendToInfluxDB() { - local curlCode + local curlCode dataPoint TIMESTAMP="$1" PING="$2" JITTER="$3" @@ -3508,10 +3508,12 @@ SendToInfluxDB() printf '' > "$curlOutLogFile" printf '' > "$curlErrLogFile" + dataPoint="ping=${PING},jitter=${JITTER},linequality=${LINEQUAL},source=$SCRIPT_NAME" + curl -vSL --retry 4 --retry-delay 5 --connect-timeout 60 -o "$curlOutLogFile" \ - "${INFLUXDB_PROTO}://${INFLUXDB_HOST}:${INFLUXDB_PORT}/api/v2/write?org=${INFLUXDB_ORG}&bucket=${INFLUXDB_BID}&precision=s" \ - --header "Authorization: Token $INFLUX_AUTHHEADER" --header "Accept-Encoding: gzip" \ - --data-raw "pingTest,ping=$PING ${TIMESTAMP},jitter=$JITTER ${TIMESTAMP},linequality=$LINEQUAL $TIMESTAMP" >> "$curlErrLogFile" 2>&1 +"${INFLUXDB_PROTO}://${INFLUXDB_HOST}:${INFLUXDB_PORT}/api/v2/write?org=${INFLUXDB_ORG}&bucket=${INFLUXDB_BID}&precision=s" \ +--header "Authorization: Token $INFLUX_AUTHHEADER" --header "Accept-Encoding: gzip" \ +--data-raw "PingTest,$dataPoint router=\"${ROUTER_MODEL}\" $TIMESTAMP" >> "$curlErrLogFile" 2>&1 curlCode="$?" "$isInteractive" && echo