A tracker to monitor the number of players connected to Minecraft / Source (Gmod, CS, CSGO) / FiveM servers
This TypeScript script retrieves the number of players connected to a game server specified in the configuration file. The results are stored in a PostgreSQL database and displayed on a Grafana dashboard.
This API was inspired by the Lametric Clock app project : GameServerTracker-LametricApp
- Minecraft Java Edition
- Source (All servers using the Source game engine like : Half-Life, Counter-Strike, Team Fortress 2, GMod, etc)
- FiveM / RedM (ONLY By Address)
- Docker & Docker-compose
- NodeJS
- A job scheduler like crontab (recommended)
$ git clone https://github.com/BliTz037/GameServerTracker-Tracker.git
$ cd GameServerTracker-Tracker/
$ npm install
OR
$ yarn install
$ touch .env
The environement variable required
POSTGRES_HOST=localhost
POSTGRES_USER=root
POSTGRES_PASSWORD=root
POSTGRES_DB=server
#LOGIN FOR GRAFANA
GF_SECURITY_ADMIN_USER=admin
GF_SECURITY_ADMIN_PASSWORD=admin
- Open file
serverList.ts
You will see a variable named : serverList with some examples
const serverList: IServer[] = [
{
name: "Hypixel",
type: ServerType.Minecraft,
address: "mc.hypixel.net"
},
{
name: "VLife",
type: ServerType.Source,
address: "192.168.1.237:27015"
},
{
name: "GTA RP",
type: ServerType.FiveM,
address: "address.com"
}
]
- Delete the content of array, and add your server
$ docker-compose up
$ npx tsc
$ node dist/src/index.js
$ crontab -e
Add this line
# Every 10 minutes
*/10 * * * * node /your_path/GameServerTracker-Tracker/dist/src/index.js
- Author - BliTz_37 - A guy from Tek