Skip to content

Monitoring a TrinityCore server

Required Software ​

Statistic and metric logging in TrinityCore is implemented using two projects, InfluxDB, a time-series data storage and Grafana, graph and a dashboard builder for visualizing time series metrics.

Installing InfluxDB ​

  1. Download and install InfluxDB 1.x from https://influxdata.com/downloads/#influxdb for your platform. InfluxDB 2.x is not currently supported.
  2. Start InfluxDB
  3. Create a user and a database in InfluxDB using the Influx CLI and executing the commands below
CREATE DATABASE worldserver
CREATE USER grafana WITH PASSWORD 'grafana'
GRANT READ ON worldserver TO grafana
  1. Edit the default retention policy to ensure the InfluxDB database doesn't grow too much.
USE worldserver
SHOW RETENTION POLICIES

Refer to https://docs.influxdata.com/influxdb/v1.8/query_language/manage-database/ on how to manage retention policies.

Installing Grafana ​

  1. Download and install Grafana from http://docs.grafana.org/installation/
  2. Open the dashboard at http://localhost:3000
  3. Login with username admin and password admin (defaults can be changed in Grafana's .ini files)
  4. Go to Data Sources → + Add Data Source
  5. Name: Influx
  6. Type: InfluxDB
  7. Url: http://localhost:8086
  8. Access: Server
  9. Database: worldserver User: grafana Password: grafana
  10. Click on the + sign in the menu on the left called "Create" and select "Dashboard", then import each .json file in TrinityCore's /contrib/grafana clicking on "Upload JSON file"

Configuring TrinityCore ​

  1. Edit the worldserver.conf file
  2. Set Metric.Enable = 1
  3. Edit Metric.ConnectionInfo with connection details (e.g "127.0.0.1;8086;worldserver")
  4. Start worldserver, the dashboard should now start receiving values

Implemented ✅ planned ❌

Technical oriented ​

  • I/O networking traffic:
  • Packets sent ❌
  • Packets received ✅
  • Average ping ❌
  • Traffic in ❌
  • Traffic out ❌
  • World session update time ✅
  • Map update time ✅
  • Map loads/unloads ✅
  • MMap queries ✅
  • Database async queries queued count ✅
  • Server uptime ✅ (through world initialize and world shutdown events)
  • Active connections ❌
  • Queued connections ❌

Game oriented ​

  • Players online ✅
  • Logins per hour, per day, day of week, etc ✅
  • Mails sent ❌
  • Auction house usage ❌
  • Character levels ❌
  • Gold earn/spend ❌
  • LFG queues ❌