Browse Source

add server date and other details improvements

pull/3315/head
Daniel Gibbs 5 years ago
parent
commit
b4b93b36f1
  1. 2
      lgsm/functions/alert.sh
  2. 3
      lgsm/functions/info_distro.sh
  3. 24
      lgsm/functions/info_messages.sh

2
lgsm/functions/alert.sh

@ -7,6 +7,8 @@
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Generates alert log of the details at the time of the alert.
# Used with email alerts.
fn_alert_log(){ fn_alert_log(){
info_distro.sh info_distro.sh
info_config.sh info_config.sh

3
lgsm/functions/info_distro.sh

@ -81,6 +81,9 @@ else
fi fi
fi fi
## Date
date="$(date)"
## Uptime ## Uptime
uptime=$(</proc/uptime) uptime=$(</proc/uptime)
uptime=${uptime/[. ]*/} uptime=${uptime/[. ]*/}

24
lgsm/functions/info_messages.sh

@ -53,11 +53,11 @@ fn_info_message_password_strip(){
fi fi
} }
# Standard Details # Alert Summary
# This applies to all engines # used with alertlog
fn_info_message_head(){ fn_info_message_head(){
echo -e "" echo -e ""
echo -e "${lightyellow}Summary${default}" echo -e "${lightyellow}Alert Summary${default}"
fn_messages_separator fn_messages_separator
echo -e "Message" echo -e "Message"
echo -e "${alertbody}" echo -e "${alertbody}"
@ -72,17 +72,14 @@ fn_info_message_head(){
echo -e "${HOSTNAME}" echo -e "${HOSTNAME}"
echo -e "" echo -e ""
echo -e "Server IP" echo -e "Server IP"
if [ "${multiple_ip}" == "1" ]; then echo -e "${ip}:${port}"
echo -e "NOT SET"
else
echo -e "${ip}:${port}"
fi
} }
fn_info_message_distro(){ fn_info_message_distro(){
# #
# Distro Details # Distro Details
# ================================= # =================================
# Date: Sun 21 Feb 2021 09:22:53 AM UTC
# Distro: Ubuntu 20.04.2 LTS # Distro: Ubuntu 20.04.2 LTS
# Arch: x86_64 # Arch: x86_64
# Kernel: 5.4.0-65-generic # Kernel: 5.4.0-65-generic
@ -95,6 +92,7 @@ fn_info_message_distro(){
echo -e "${lightyellow}Distro Details${default}" echo -e "${lightyellow}Distro Details${default}"
fn_messages_separator fn_messages_separator
{ {
echo -e "${lightblue}Date:\t${default}${date}"
echo -e "${lightblue}Distro:\t${default}${distroname}" echo -e "${lightblue}Distro:\t${default}${distroname}"
echo -e "${lightblue}Arch:\t${default}${arch}" echo -e "${lightblue}Arch:\t${default}${arch}"
echo -e "${lightblue}Kernel:\t${default}${kernel}" echo -e "${lightblue}Kernel:\t${default}${kernel}"
@ -187,7 +185,7 @@ fn_info_message_gameserver_resource(){
echo -e "${lightyellow}Game Server Resource Usage${default}" echo -e "${lightyellow}Game Server Resource Usage${default}"
fn_messages_separator fn_messages_separator
{ {
if [ "${status}" != "0" ]; then if [ "${status}" != "0" ]&&[ -v status ]; then
echo -e "${lightblue}CPU Used:\t${default}${cpuused}%${default}" echo -e "${lightblue}CPU Used:\t${default}${cpuused}%${default}"
echo -e "${lightblue}Mem Used:\t${default}${pmemused}%\t${memused}MB${default}" echo -e "${lightblue}Mem Used:\t${default}${pmemused}%\t${memused}MB${default}"
else else
@ -257,11 +255,7 @@ fn_info_message_gameserver(){
fi fi
# Server ip # Server ip
if [ "${multiple_ip}" == "1" ]; then echo -e "${lightblue}Server IP:\t${default}${ip}:${port}"
echo -e "${lightblue}Server IP:\t${default}NOT SET"
else
echo -e "${lightblue}Server IP:\t${default}${ip}:${port}"
fi
# Internet ip # Internet ip
if [ -n "${extip}" ]; then if [ -n "${extip}" ]; then
@ -460,7 +454,7 @@ fn_info_message_gameserver(){
fi fi
fi fi
# Online status # Game server status
if [ "${status}" == "0" ]; then if [ "${status}" == "0" ]; then
echo -e "${lightblue}Status:\t${red}STOPPED${default}" echo -e "${lightblue}Status:\t${red}STOPPED${default}"
else else

Loading…
Cancel
Save