How to create a metrics dashboard for a MU server
Build a complete metrics dashboard for your MU Online server, covering online players, machine health, game economy and automatic security alerts.
You cannot manage what you cannot measure. Many MU Online servers are managed in the dark: the admin only finds out the machine is overloaded when players start complaining about lag, or only notices item duplication when the economy has already collapsed. A metrics dashboard solves this by turning
You cannot manage what you cannot measure. Many MU Online servers are managed in the dark: the admin only finds out the machine is overloaded when players start complaining about lag, or only notices item duplication when the economy has already collapsed. A metrics dashboard solves this by turning the server's state into visible, historical numbers, letting you act before the problem becomes a crisis.
In this tutorial you will build a practical metrics dashboard combining data from three sources: the machine (operating system), the game server process and the MU database. We will use an open, common stack - a time-series collector, a storage layer and a visualization layer - but the concepts apply to any tool. Table and column names vary by season/emulator (Season 6, IGCN, MuEMU, X-Files, etc.), so treat the SQL queries as EXAMPLES and adapt them to your structure.
Prerequisites
Before you start, have at hand:
- Administrative access to the game server machine.
- A second machine or small VPS to host the collector and the dashboard (recommended, so it does not compete for resources with the game).
- Read access to the MU database (create a
metrics_rouser withSELECTonly). - Basic familiarity with SQL and with editing configuration files.
- Ports opened between the collector and the game machine (only on the internal network or via VPN, never exposed to the internet).
Never use the sa account or the application user to collect metrics. A dedicated read-only user limits the damage if the dashboard credentials leak.
Step 1 - Define what to measure
Before installing any tool, decide which questions the dashboard needs to answer. A common mistake is to collect everything and look at nothing. Split the metrics into four categories:
- Machine health: CPU, memory, disk, network, uptime.
- Game service health: GameServer/ConnectServer processes alive, login latency, queues.
- Player activity: online accounts, characters created, distribution by map.
- Economy and security: circulating zen, excellent items created per hour, resets per hour, login failures.
The economy and security category is the one that most sets an amateur dashboard apart from a professional one, because that is where you detect duplication, bots and intrusions.
Step 2 - Dashboard architecture
The recommended architecture has three components:
- Collector/exporter: reads metrics from the machine and the database and exposes them in a standardized format.
- Time-series database: stores the collected points over time.
- Visualization layer: builds the charts and triggers alerts.
A popular, free set is Prometheus (collection + storage) with Grafana (visualization), plus a node_exporter for machine metrics and a small script that queries the MU database and exposes game metrics. The exact choice is secondary; what matters is separating collection, storage and visualization.
Step 3 - Collect machine metrics
Install a system metrics exporter on the game machine. It exposes CPU, memory, disk and network on an endpoint that the collector reads periodically. On the collector side, configure a target pointing to that endpoint, accessible only from the internal network:
scrape_configs:
- job_name: 'mu-maquina'
scrape_interval: 15s
static_configs:
- targets: ['10.0.0.5:9100'] # internal IP of the game machine
With this you already get CPU and memory usage charts. Set alerts for sustained usage above 85% CPU or 90% disk, which are the most common bottlenecks on MU servers during an event.
Step 4 - Collect game database metrics
This is the heart of the dashboard. Write a small exporter that runs periodic SQL queries with the metrics_ro user and publishes the results as metrics. Query examples (adapt the table names):
-- Accounts currently online
SELECT COUNT(*) AS online FROM MEMB_STAT WHERE ConnectStat = 1;
-- Total zen in circulation (sum across characters)
SELECT SUM(CAST(Money AS BIGINT)) AS zen_total FROM Character;
-- Resets performed in the last 24h (if there is a log column)
SELECT COUNT(*) AS resets_24h
FROM ResetLog
WHERE ResetDate >= DATEADD(HOUR, -24, GETDATE());
Publish each result as a named metric (for example, mu_online_accounts, mu_zen_total, mu_resets_24h). Run the game queries every 1-5 minutes; heavy queries running every second hurt game performance. Always use indexes and avoid SELECT * on large tables.
Step 5 - Build the visual dashboards
On the visualization layer, create thematic dashboards. A good starting set:
- Overview: online players, uptime, CPU and memory on a single screen.
- Economy: total zen, zen created per hour, excellent items generated per hour.
- Security: login failures per minute, accounts created per IP, GM commands used.
- Infrastructure: disk, network, database latency.
Use line charts for trends and instant values (single stat) for the current state. Mark thresholds with colors: green for normal, yellow for warning, red for critical.
Step 6 - Configure alerts
A dashboard nobody looks at prevents nothing. Configure alerts that push the information to you (email, Discord webhook, Telegram). Examples of useful rules:
- CPU above 90% for more than 5 minutes.
- GameServer process absent (online dropped to zero abruptly).
- Total zen growing more than X% in one hour (possible duplication).
- More than N login failures per minute coming from the same IP (brute force).
- Disk with less than 10% free.
Table of essential metrics
| Metric | Source | Interval | Why it matters |
|---|---|---|---|
| Online accounts | Game database | 1 min | Health and popularity |
| CPU / memory | Machine exporter | 15-30 s | Predicts lag and crashes |
| Zen in circulation | Game database | 5 min | Detects duplication and inflation |
| Excellent items/hour | Game database | 5 min | Detects drop exploits |
| Resets/hour | Game database | 5 min | Detects reset bots |
| Login failures/min | Access log | 1 min | Detects brute force |
| Free disk | Machine exporter | 1 min | Prevents a total freeze |
| Service uptime | Process check | 30 s | Detects crashes |
Table of alert thresholds (example)
| Signal | Warning (yellow) | Critical (red) |
|---|---|---|
| Sustained CPU | > 80% | > 90% for 5 min |
| Free disk | < 20% | < 10% |
| Zen created/hour | +30% | +100% |
| Login failures/min per IP | > 20 | > 60 |
| Online players | 30% drop | drop to 0 |
The numbers above are an EXAMPLE starting point and vary by season/emulator, community size and time of day. Adjust the thresholds after observing your server's normal behavior for a few days.
Common errors and fixes
| Problem | Likely cause | Fix |
|---|---|---|
| Dashboard tanks game performance | Heavy queries at high frequency | Reduce the frequency and add indexes |
| Metrics vanish when the game crashes | Collector on the same machine | Run the collector and dashboard on a separate VPS |
| False alert on every event | Threshold too rigid | Adjust thresholds by time/load |
| Nobody sees the alerts | Only on the dashboard, no push | Send via Discord/Telegram/email |
| Dashboard credential with full access | Use of the application account | Create a dedicated read-only user |
| Charts with no history | Retention too short | Increase the time-series database retention |
Operational best practices
Document the meaning of each dashboard so any team member understands an alert at 3 a.m. Back up the dashboard definitions along with the rest of the server. Review the thresholds monthly, because the player base and events change what is normal. And treat the security dashboard as seriously as the technical one: many intrusions and duplications are detectable through anomalies in the economy metrics before any player report.
Launch checklist
- Metric categories defined (machine, service, players, economy)
metrics_roread-only user created- Collector and dashboard running on a separate machine
- Machine exporter installed and collecting
- Game SQL queries validated and indexed
- Overview, economy, security and infrastructure dashboards built
- CPU, disk, online, zen and login-failure alerts configured
- Alerts sent via a push channel (Discord/Telegram/email)
- Thresholds calibrated to the observed normal behavior
- Adequate history retention with backup
- Metrics endpoints closed to the internet
- Dashboard documentation shared with the team
With the dashboard live, you stop managing in the dark and start anticipating performance, economy and security problems. If you are still structuring the server, the how to create a MU Online server guide helps you build the foundation the monitoring will run on. A good dashboard is not a luxury: it is the difference between reacting to fires and preventing them.
Frequently asked questions
Do I need separate servers for the metrics dashboard?
Ideally yes. Running the collector and the dashboard on the same machine as the game competes for resources and goes down with it if the machine crashes. A small separate VPS is ideal.
What is the difference between technical metrics and game metrics?
Technical metrics measure machine health (CPU, RAM, disk). Game metrics measure player behavior (online, circulating zen, resets per hour). You need both.
Can I set this up without knowing how to program?
Partially. Tools like Grafana and Prometheus do a lot with configuration. But collecting metrics from inside the game usually requires SQL queries, which calls for some technical knowledge.
How often should I collect metrics?
Machine metrics every 15-30 seconds; game and economy metrics every 1-5 minutes. Collecting too often generates noise and storage cost with no gain.
Do metrics help with security?
A lot. An abnormal spike in created zen, online accounts or login failures is usually the first sign of item duplication, a bot or an intrusion.