From 8043718a77cdf3c399842dd9fef0a31387663693 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 15 Aug 2023 23:03:11 +0100 Subject: [PATCH] feat: update server stats and enabled alerts - Updated the server stats to include virtual environment, LinuxGSM version, and enabled alerts. - Removed unnecessary code for sending alert statistics. --- lgsm/modules/info_stats.sh | 44 ++++++++++++-------------------------- 1 file changed, 14 insertions(+), 30 deletions(-) diff --git a/lgsm/modules/info_stats.sh b/lgsm/modules/info_stats.sh index 11a94c6a1..4d72f4fc9 100644 --- a/lgsm/modules/info_stats.sh +++ b/lgsm/modules/info_stats.sh @@ -110,38 +110,19 @@ curl -X POST https://stats.linuxgsm.com/api/event \ \"serverdisk\": \"${totalspace}\", \"serverram\": \"${physmemtotal}\", \"version\": \"${version}\", - \"virtualenvironment\": \"${virtualenvironment}\" + \"virtualenvironment\": \"${virtualenvironment}\", + \"discordalert\": \"${discordalert}\", + \"emailalert\": \"${emailalert}\", + \"gotifyalert\": \"${gotifyalert}\", + \"iftttalert\": \"${iftttalert}\", + \"mailgunalert\": \"${mailgunalert}\", + \"pushbulletalert\": \"${pushbulletalert}\", + \"pushoveralert\": \"${pushoveralert}\", + \"rocketchatalert\": \"${rocketchatalert}\", + \"slackalert\": \"${slackalert}\", + \"telegramalert\": \"${telegramalert}\" }" -## 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 -fi -if [ "${emailalert}" == "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=Email" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 -fi -if [ "${iftttalert}" == "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=IFTTT" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 -fi -if [ "${mailgunalert}" == "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=Mailgun" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 -fi -if [ "${pushbulletalert}" == "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=Pushbullet" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 -fi -if [ "${pushoveralert}" == "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=Pushover" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 -fi -if [ "${rocketchatalert}" == "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=Rocket Chat" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 -fi -if [ "${slackalert}" == "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=Slack" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 -fi -if [ "${telegramalert}" == "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=Telegram" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 -fi - fn_script_log_info "Send LinuxGSM stats" fn_script_log_info "* uuid-${selfname}: ${uuidinstance}" fn_script_log_info "* uuid-install: ${uuidinstall}" @@ -155,3 +136,6 @@ fn_script_log_info "* Server CPU Model: ${cpumodel}" fn_script_log_info "* Server CPU Frequency: ${cpufreqency}" fn_script_log_info "* Server RAM: ${physmemtotal}" fn_script_log_info "* Server Disk: ${totalspace}" +fn_script_log_info "* Virtual Environment: ${virtualenvironment}" +fn_script_log_info "* LinuxGSM Version: ${version}" +fn_script_log_info "* Enabled Alerts"