All Projects → itzg → mc-monitor

itzg / mc-monitor

Licence: MIT License
Monitor the status of Minecraft servers and provides Prometheus exporter and Influx line protocol output

Programming Languages

go
31211 projects - #10 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to mc-monitor

Minecraft Prometheus Exporter
A Bukkit plugin which exports minecraft server stats to Prometheus
Stars: ✭ 150 (+50%)
Mutual labels:  minecraft-server, prometheus-exporter
drmon
Draconic Reactor computercraft monitoring and failsafe interface
Stars: ✭ 48 (-52%)
Mutual labels:  monitor
failsafe-actuator
Endpoint library for the failsafe framework
Stars: ✭ 52 (-48%)
Mutual labels:  monitor
Minecraft-Server-Status
✅一个用于显示服务器在线信息及其他内容的网站
Stars: ✭ 22 (-78%)
Mutual labels:  minecraft-server
starboard-exporter
A standalone exporter for vulnerability reports and other CRs created by Starboard.
Stars: ✭ 22 (-78%)
Mutual labels:  prometheus-exporter
deluge exporter
Prometheus exporter for the Deluge BitTorrent client
Stars: ✭ 24 (-76%)
Mutual labels:  prometheus-exporter
postgres exporter
Postgres exporter
Stars: ✭ 14 (-86%)
Mutual labels:  prometheus-exporter
spot-termination-exporter
Prometheus spot instance exporter to monitor AWS instance termination with Hollowtrees
Stars: ✭ 30 (-70%)
Mutual labels:  prometheus-exporter
Node-MineiaGo
A proxy to bridge Bedrock (Minecraft Pocket Edition, Minecraft Console Editions and Windows 10 Edition) with Minecraft Java Edition.
Stars: ✭ 15 (-85%)
Mutual labels:  minecraft-server
Desktopmagic
Robust multi-monitor screenshot grabbing library for Python 2.x/3.x on Windows
Stars: ✭ 52 (-48%)
Mutual labels:  monitor
sentry exporter
Prometheus exporter for Sentry
Stars: ✭ 23 (-77%)
Mutual labels:  prometheus-exporter
zabbix-monitor
monitor system based on zabbix API pyzaabix grafana
Stars: ✭ 70 (-30%)
Mutual labels:  monitor
ScriptableMC-Engine
Create TypeScript/JavaScript plugins for Minecraft 1.16 Bukkit/Spigot/Paper
Stars: ✭ 36 (-64%)
Mutual labels:  minecraft-server
gin-metrics
gin-gonic/gin metrics for prometheus.
Stars: ✭ 87 (-13%)
Mutual labels:  prometheus-exporter
ReSwiftMonitor
ReSwift+redeux dev tools
Stars: ✭ 13 (-87%)
Mutual labels:  monitor
nvidia gpu exporter
Nvidia GPU exporter for prometheus using nvidia-smi binary
Stars: ✭ 85 (-15%)
Mutual labels:  prometheus-exporter
zfs exporter
Prometheus ZFS exporter
Stars: ✭ 52 (-48%)
Mutual labels:  prometheus-exporter
healthchecksio
Update and display the status of your healthchecks.io checks.
Stars: ✭ 30 (-70%)
Mutual labels:  monitor
Docker-Minecraft-PaperMC-Server
Starts a Minecraft PaperMC 1.18 server
Stars: ✭ 80 (-20%)
Mutual labels:  minecraft-server
prometheus-mysql-exporter
Prometheus MySQL Exporter
Stars: ✭ 33 (-67%)
Mutual labels:  prometheus-exporter

Docker Pulls GitHub release (latest SemVer) Test

Command/agent to monitor the status of Minecraft servers

Install module

go get github.com/itzg/go-mc-status

Usage

Subcommands:
	flags            describe all known top-level flags
	help             describe subcommands and their syntax
	version          Show version and exit

Subcommands for monitoring:
	export-for-prometheus  Registers an HTTP metrics endpoints for Prometheus export
	gather-for-telegraf  Periodically gathers to status of one or more Minecraft servers and sends metrics to telegraf over TCP using Influx line protocol

Subcommands for status:
	status           Retrieves and displays the status of the given Minecraft server
	status-bedrock   Retrieves and displays the status of the given Minecraft Bedrock Dedicated server

Examples

Checking the status of a server

To check the status of a Java edition server:

docker run -it --rm itzg/mc-monitor status --host mc.hypixel.net

To check the status of a Bedrock Dedicated server:

docker run -it --rm itzg/mc-monitor status-bedrock --host play.fallentech.io

where exit code will be 0 for success or 1 for failure.

Monitoring a server with Telegraf

The following example is provided in examples/mc-monitor-telegraf

Given the telegraf config file:

[[inputs.socket_listener]]
  service_address = "tcp://:8094"

[[outputs.file]]
  files = ["stdout"]

...and a Docker composition of telegraf and mc-monitor services:

version: '3'

services:
  telegraf:
    image: telegraf:1.13
    volumes:
    - ./telegraf.conf:/etc/telegraf/telegraf.conf:ro
  monitor:
    image: itzg/mc-monitor
    command: gather-for-telegraf
    environment:
      GATHER_INTERVAL: 10s
      GATHER_TELEGRAF_ADDRESS: telegraf:8094
      GATHER_SERVERS: mc.hypixel.net

The output of the telegraf service will show metric entries such as:

minecraft_status,host=mc.hypixel.net,port=25565,status=success response_time=0.172809649,online=51201i,max=90000i 1576971568953660767
minecraft_status,host=mc.hypixel.net,port=25565,status=success response_time=0.239236074,online=51198i,max=90000i 1576971579020125479
minecraft_status,host=mc.hypixel.net,port=25565,status=success response_time=0.225942383,online=51198i,max=90000i 1576971589006821324

Monitoring a server with Prometheus

When using the export-for-prometheus subcommand, mc-monitor will serve a Prometheus exporter on port 8080, by default, that collects Minecraft server metrics during each scrape of /metrics.

The sub-command accepts the following arguments, which can also be viewed using --help:

  -bedrock-servers host:port
    	one or more host:port addresses of Bedrock servers to monitor, when port is omitted 19132 is used (env EXPORT_BEDROCK_SERVERS)
  -port int
    	HTTP port where Prometheus metrics are exported (env EXPORT_PORT) (default 8080)
  -servers host:port
    	one or more host:port addresses of Java servers to monitor, when port is omitted 25565 is used (env EXPORT_SERVERS)

The following metrics are exported

  • minecraft_status_healthy
  • minecraft_status_response_time_seconds
  • minecraft_status_players_online_count
  • minecraft_status_players_max_count

with the labels

  • server_host
  • server_port
  • server_edition : java or bedrock
  • server_version

An example Docker composition is provided in examples/mc-monitor-prom, which was used to grab the following screenshot:

Prometheus Chart

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].