From 98d6d87b054e423df9ce899e17095c0d0b42ca20 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 14 Aug 2023 21:24:33 +0100 Subject: [PATCH] add plausable event api --- lgsm/modules/info_stats.sh | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/lgsm/modules/info_stats.sh b/lgsm/modules/info_stats.sh index aa02f5abc..ad1bd6778 100644 --- a/lgsm/modules/info_stats.sh +++ b/lgsm/modules/info_stats.sh @@ -61,7 +61,6 @@ memusedroundup="$(((memused + 99) / 100 * 100))" # Install Property - UA-165287622-2 # Hardware Property - UA-165287622-3 - curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=A-OzP02TSMWt4_vHi6ZpUw&measurement_id=G-0CR8V7EMT5" -H "Content-Type: application/json" -d " { \"client_id\": \"${uuidinstance}\", @@ -89,6 +88,28 @@ curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=A-OzP02TSMW ] }" +curl -i -X POST https://stats.linuxgsm.com/api/event \ + -H 'X-Forwarded-For: 127.0.0.1' \ + -H 'Content-Type: application/json' \ + --data "{\"name\":\"linuxgsm\", + \"url\":\"https://stats.linuxgsm.com\", + \"domain\":\"stats.linuxgsm.com\", + \"cpuusedmhzroundup\": \"${cpuusedmhzroundup}MHz\", + \"memusedroundup\": \"${memusedroundup}MB\", + \"serverfilesdu\": \"${serverfilesdu}\", + \"uuidhardware\": \"${uuidhardware}\", + \"uuidinstall\": \"${uuidinstall}\", + \"uuidinstance\": \"${uuidinstance}\", + \"diskused\": \"${serverfilesdu}\", + \"distro\": \"${distroname}\", + \"game\": \"${gamename}\", + \"ramused\": \"${memusedroundup}MB\", + \"servercpu\": \"${cpumodel} ${cpucores} cores\", + \"servercpufreq\": \"${cpufreqency} x${cpucores}\", + \"serverdisk\": \"${totalspace}\", + \"serverram\": \"${physmemtotal}\", + \"version\": \"${version}\" + }" ## Alert Stats. if [ "${discordalert}" == "on" ]; then curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=alert" -d "ea=Discord" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1