Categorygithub.com/sch8ill/mcmon
repository
0.2.4
Repository: https://github.com/sch8ill/mcmon.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# README

mcmon

Release Go Report Card MIT license


mcmon is a Prometheus exporter designed to monitor Minecraft Servers using SLP, providing essential metrics to track server info and player activity.

mcmon is built using mclib.


Installation

Docker

docker run -p 9100:9100 sch8ill/mcmon:latest --server 2b2t.org

mcmon can monitor multiple Minecraft Servers simultaneously: mcmon --server mc.example.com --server foo.bar.com

Build

Requires:

go >= 1.21
make

Build command:

make build

Usage

Metrics

namedescriptionlabelstype
mcmon_onlinewether the Minecraft Server is onlineservergauge
mcmon_players_onlinenumber of current online players on the Minecraft Serverservergauge
mcmon_players_maxmax number of players allowed on the Minecraft Serverservergauge
mcmon_versionversion name of the Minecraft Serverserver, versiongauge
mcmon_protocol_versionprotocol version of the Minecraft Serverservergauge
mcmon_descriptiondescription of the Minecraft Serverserver, descriptiongauge
mcmon_latencylatency of the Minecraft Server in msservergauge

Prometheus config

Example prometheus.yml scrape config:

scrape_configs:
  - job_name: mcmon
    scrape_interval: 30s
    static_configs:
      - targets: ["localhost:9100"]

Grafana

An example Grafana panel can be found in the grafana directory.

panel

CLI flags

   --server value [ --server value ]  address of the server to be monitored (default: "localhost:25565")
   --timeout value                    max timeout for SLP requests (default: 5s)
   --interval value                   interval the servers should checked in (default: 30s)
   --metrics-address value            address the Prometheus metrics exporter listens on (default: ":9100")
   --help, -h                         show help

License

This package is licensed under the MIT License.