Jump to content

[REL] Python MTA:SA server monitoring script


Lipau3n

Recommended Posts

Hello,

I present to you a simple monitoring script for your server written in Python 3.

This script will be useful for your site, for example, if you are developing it using Django / AIOHTTP / Flask or for other purposes.

This script provides simple server information:

  • game (mta)
  • port - server main port (UDP)
  • ase_port - server All Seeing Eye port (main MTA:SA port + 123)
  • name - server name
  • gamemode - server mode
  • map - server map
  • version - mta:sa server version
  • players - number of players on the server right now
  • maxplayers - the maximum number of players that can join

Usage:

from mta.monitoring import Server

# pass server address and port
s = Server('46.243.253.51', 22003)

# get current server online and max players
print('{}/{}'.format(s.players, s.maxplayers))

Download & Source code: github

  • Like 2
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...