Is there a way to ping a Minecraft server for basic information?

by WoJ   Last Updated August 13, 2019 18:14 PM - source

I am setting up a basic monitoring (with monit) for my children's Minecraft server.

My plan is to check whether port 25565 is open but it would be nice if I could gather some more information to check if the server state, as announced, is healthy.

I tried to nc on its port but there is no feedback to random output. I also saw that the Minecraft wiki has information about the structure of packets but it is not obvious that this can be used to check an initial connection.

Is there something like the equivalent of EHLO for SMTP (or any other text-based protocols) to check for a Minecraft server self-announced status? I am sure there must be something since a server announces e.g. the number of available connections - though it may be part of a more sophisticated exchange between the client and the server.

Answers 2

I know of no purely text based protocols, but parsers exist to take the binary data from the server and make something readable out of it.

A long while ago, I used this PHP-Minecraft-Query script to push server data into a monitoring system. I don't have the code around anymore (that was a long time ago), but this may give you exactly what you need.

Mikey T.K.
Mikey T.K.
October 31, 2016 22:11 PM

mcstatus is a tool written in Python that can query a Minecraft (non-Win10 edition) server for basic information about the server state such as the server version, how many player slots it has, and how many players are online. It is written and maintained by one of the Minecraft developers.

November 01, 2016 17:25 PM

Related Questions

Friends no longer able to connect to my personal server

Updated November 10, 2018 00:14 AM

Minecraft Server connection timeout issues from outside

Updated November 06, 2018 20:14 PM

Setting up new FTB server on Windows Server

Updated October 09, 2016 09:06 AM

What's the bottleneck for block lag?

Updated January 27, 2018 19:14 PM