File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed
Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 1616
1717/usr/sbin/phonehome | curl -m 180 --retry 3 -L -s \
1818 -H " Content-type: application/json" -H " Accept: application/json" \
19- --data-binary @- " $URL " > /dev/null
19+ --data-binary @- " $URL " > /dev/null
Original file line number Diff line number Diff line change 1010SYSTEM_ID=$( uci -q get ns-plug.config.system_id)
1111SYSTEM_SECRET=$( uci -q get ns-plug.config.secret)
1212URL=$( uci -q get ns-plug.config.alerts_url) " heartbeats/store"
13+ TYPE=$( uci -q get ns-plug.config.type)
1314
1415if [ -z " $SYSTEM_ID " ] || [ -z " $SYSTEM_SECRET " ]; then
1516 # System ID or system secret not found, configure ns-plug
1920/usr/bin/curl -m 180 --retry 3 -L -s \
2021 --header " Authorization: token $SYSTEM_SECRET " --header " Content-Type: application/json" --header " Accept: application/json" \
2122 --data-raw ' {"lk": "' $SYSTEM_ID ' "}' " $URL " > /dev/null
23+
24+ # Temporary send data to new endpoint
25+ # To be removed when the migration to new my.nethesis.it will be completed
26+ if [ " $TYPE " = " enterprise" ]; then
27+ /usr/bin/curl -m 180 --retry 3 -L -s -X POST \
28+ --user " $SYSTEM_ID :$SYSTEM_SECRET " https://my.nethesis.it/proxy/heartbeat > /dev/null
29+ exit 0
30+ fi
Original file line number Diff line number Diff line change @@ -35,4 +35,10 @@ if [ "$TYPE" = "enterprise" ]; then
3535 /usr/bin/curl -m 180 --retry 5 -L -s \
3636 --header " Content-Type: application/json" --header " Accept: application/json" \
3737 -d ' {"secret":"' $SYSTEM_SECRET ' "}' https://my.nethesis.it/api/systems/info > /dev/null
38+
39+ # Temporary send data to new endpoint
40+ # To be removed when the migration to new my.nethesis.it will be completed
41+ /usr/sbin/phonehome | /usr/bin/curl -m 180 --retry 3 -L -s --user " $SYSTEM_ID :$SYSTEM_SECRET " \
42+ -H " Content-Type: application/json" \
43+ --data-binary @- https://my.nethesis.it/proxy/inventory > /dev/null || exit 0
3844fi
You can’t perform that action at this time.
0 commit comments