LogoLogo
  • Home
  • Getting Started
  • Configuration
    • LinuxGSM Config
    • Game Server Config
    • Start Parameters
    • cronjobs
    • Running on Boot
    • Running Multiple Game Servers
    • IP Address Configuration
    • LinuxGSM Stats
  • Commands
    • install
    • start-stop-restart
    • monitor
    • test-alert
    • console
    • debug
    • update
    • check-update
    • force-update
    • validate
    • update-lgsm
    • backup
    • map-compressor
    • details
    • mods
    • skeleton
    • fastdl
    • change-password
  • Game Servers
    • 7 Days to Die
    • Arma 3
    • ARK: Survival Evolved
    • Call of Duty 4
    • Dont Starve Together
    • Counter-Strike 2
    • Counter-Strike: Global Offensive
    • Factorio
    • Garry's Mod
    • Insurgency: SandStorm
    • Killing Floor 2
    • Minecraft: Java Edition
    • Multi Theft Auto
    • Rust
    • Sven Co-op
    • Trackmania Nations Forever / Trackmania United Forever
    • TeamSpeak 3
    • Unreal Tournament 99
    • Unreal Tournament 2004
    • Unreal Tournament 3
    • Valheim
    • Xonotic
    • The Front [WIP]
  • Networking
    • IP Address
    • Ports
    • Source Engine
  • Alerts
    • Discord
    • Email
    • IFTTT
    • Pushbullet
    • Pushover
    • Rocket.Chat
    • Slack
    • Telegram
  • Dependencies
    • Java
    • tmux
    • jq
    • gamedig
    • glibc
  • Features
    • ANSI Colors
    • Stop Mode
    • Log Management
    • Message Display Time
  • SteamCMD
    • Steam Master Server
    • Game Server Login Token
    • Branch
    • LAN Discovery
    • Workshop
    • Error Codes
  • Linux
    • distro
    • ftp-scp
    • file-ownership
    • firewalls
    • network-interfaces
    • permissions
    • Symlinking and ln command
  • Troubleshooting
  • FAQ
  • Guides
    • Security
    • Make Webserver Case Insensitive
    • Sourcemod and Metamod:Source
  • Other
    • server-migration
    • basic-usage
    • brand
Powered by GitBook
On this page
  • Commands
  • How does monitor work?
  • Automated Monitoring
  • Monitor Cronjob
  • Alert Notifications
  • Query Delay
  • Monitor Activation
Edit on GitHub
Export as PDF
  1. Commands

monitor

Previousstart-stop-restartNexttest-alert

Last updated 1 year ago

monitor checks the game server to ensure the server functioning. First checking the game server process is running then querying the game server to check the game server is responding. monitor is designed to be an automated command that frequently checks the game server, rebooting and alerting if required.

Commands

Standard: ./gameserver monitor

Short: ./gameserver m

How does monitor work?

Monitor first checks that the server process or session is running. If it is, it will then attempt to query the server using or . Should this fail to query it will attempt to query every 15 seconds over 60 second period. Should this fail the server will be rebooted and an alert sent out.

During server start, map change, workshop downloads, the server is unable to answer queries.The monitor will wait for 60 seconds as it is common for servers to stop responding to queries during a map change. This wait prevents monitor from rebooting a server that does not require it.

Automated Monitoring

Monitor is designed to be and automated task, using to allow a game server to be frequently checked.

As a reminder, you can edit your cronjobs, typing :

crontab -e

Monitor Cronjob

Use these cron examples to setup automated monitoring.

Replace the username and gameserver according to your requirements.

  • A user based cronjob to monitor your server every 5 minutes .

*/5 * * * *  /home/username/gameserver monitor > /dev/null 2>&1
  • A root user based cronjob to monitor your server every 5 minutes .

*/5 * * * *  su - username -c '/home/username/gameserver monitor' > /dev/null 2>&1

Alert Notifications

Query Delay

Game Servers do not respond to queries while the server is booting. Query delay prevents monitor from giving a false positive should it query while the server is booting. A timed delay prevents monitor from using query at all during a set time (normally either 1 or 5 minutes) after start, giving the server time to boot and become ready to accept queries. Query delay timer can be adjusted using the querydelay setting.

## Monitor | https://docs.linuxgsm.com/commands/monitor
# Query delay time
querydelay="1"

Monitor Activation

Starting and stopping the game server activates and deactivates monitor. This prevents the server being manually stopped only to be started again by monitor.

To learn more about automation, see .

To be notified when a server fails alert notifications can be setup , see .

tmux
gamedig
query_gsquery.py
cronjobs
Cronjobs
alerts