@cryptotaxi247 / netdata-1 / commits / 2690887b4

Overhaul generation of distinct-ids for install telemetry events. (#13891)

Austin S. Hemmelgarn committed Nov 2, 2022 at 12:43 UTC 2690887b4ecc7d43c9d992fb3910e3fa9361ece8
1 file changed +9 -3
packaging/installer/kickstart.sh
+9 -3
@@ -248,10 +248,16 @@ telemetry_event() {
248 TOTAL_RAM="$((TOTAL_RAM * 1024))"
249 fi
250
251 - if [ -f /etc/machine-id ]; then
252 - DISTINCT_ID="$(cat /etc/machine-id)"
251 + if [ "${KERNEL_NAME}" = Darwin ] && command -v ioreg >/dev/null 2>&1; then
252 + DISTINCT_ID="macos-$(ioreg -rd1 -c IOPlatformExpertDevice | awk '/IOPlatformUUID/ { split($0, line, "\""); printf("%s\n", line[4]); }')"
253 + elif [ -f /etc/machine-id ]; then
254 + DISTINCT_ID="machine-$(cat /etc/machine-id)"
255 + elif [ -f /var/db/dbus/machine-id ]; then
256 + DISTINCT_ID="dbus-$(cat /var/db/dbus/machine-id)"
257 + elif [ -f /var/lib/dbus/machine-id ]; then
258 + DISTINCT_ID="dbus-$(cat /var/lib/dbus/machine-id)"
259 elif command -v uuidgen > /dev/null 2>&1; then
254 - DISTINCT_ID="$(uuidgen | tr '[:upper:]' '[:lower:]')"
260 + DISTINCT_ID="uuid-$(uuidgen | tr '[:upper:]' '[:lower:]')"
261 else
262 DISTINCT_ID="null"
263 fi