Sign inSign up

sch8ill/mcmon

By sch8ill

•Updated over 2 years ago

Prometheus exporter to monitor Minecraft Servers using SLP, providing metrics to track server info

Image
0

370

sch8ill/mcmon repository overview

⁠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⁠.


Tag summary

Content type

Image

Digest

sha256:e8da896f6…

Size

10.6 MB

Last updated

over 2 years ago

docker pull sch8ill/mcmon