diff options
author | Austin S. Hemmelgarn <austin@netdata.cloud> | 2022-11-02 12:43:42 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-02 12:43:42 -0400 |
commit | 2690887b4ecc7d43c9d992fb3910e3fa9361ece8 (patch) | |
tree | d8909472ae3fcabcbfb4d217bfe28e62cbfb247a | |
parent | 4aeb68234dabbb414a0b0c1599b670c02530b1c5 (diff) |
Overhaul generation of distinct-ids for install telemetry events. (#13891)
-rwxr-xr-x | packaging/installer/kickstart.sh | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/packaging/installer/kickstart.sh b/packaging/installer/kickstart.sh index 082cf0d050..6a78d56530 100755 --- a/packaging/installer/kickstart.sh +++ b/packaging/installer/kickstart.sh @@ -248,10 +248,16 @@ telemetry_event() { TOTAL_RAM="$((TOTAL_RAM * 1024))" fi - if [ -f /etc/machine-id ]; then - DISTINCT_ID="$(cat /etc/machine-id)" + if [ "${KERNEL_NAME}" = Darwin ] && command -v ioreg >/dev/null 2>&1; then + DISTINCT_ID="macos-$(ioreg -rd1 -c IOPlatformExpertDevice | awk '/IOPlatformUUID/ { split($0, line, "\""); printf("%s\n", line[4]); }')" + elif [ -f /etc/machine-id ]; then + DISTINCT_ID="machine-$(cat /etc/machine-id)" + elif [ -f /var/db/dbus/machine-id ]; then + DISTINCT_ID="dbus-$(cat /var/db/dbus/machine-id)" + elif [ -f /var/lib/dbus/machine-id ]; then + DISTINCT_ID="dbus-$(cat /var/lib/dbus/machine-id)" elif command -v uuidgen > /dev/null 2>&1; then - DISTINCT_ID="$(uuidgen | tr '[:upper:]' '[:lower:]')" + DISTINCT_ID="uuid-$(uuidgen | tr '[:upper:]' '[:lower:]')" else DISTINCT_ID="null" fi |