0

So I am trying to display memory and cpu usage of my minecraft server on my website. But i dont know how could i do that. I have searched it up on youtube, but havent found anything.

1 Answers1

1

There are many things that you can use to do.

Linux/ Hosting

If you are using a hosting company that gives you a nice looking website/panel to look at: web scraping their statistics and using it, such as taking it from this area using sort of bot. If they don't then you could look at getting a plugin or creating one such as Lag Monitor

pterodactyl statistics

They may be using Multicraft, statistics will be at the top if they have some measurement for it.

If you host the Minecraft server in a docker container then you should have a look at docker stats

If you host the Minecraft server just on the system itself using a service(systemctl) then you should refer to Retrieve CPU usage and memory usage of a single process on Linux?

You would need to create a script to get these things, return and format the value. You could either publish the statistics in almost real-time using some sort of socket connection like socket.io.

However, if that is not available then you could create an API server where ever you run the server(if on your own machine) to run these commands and allow your website to fetch the results every so often or on page load.

Windows

If you are hosting your Minecraft server on Windows then you are doing something wrong. Getting memory and CPU usage would be the least of your problems in this case and you should look into getting some proper hosting for your server.

If you are running the server on your own computer on your own network. Unless you have the experience and knowledge of doing so safely, which clearly you don't have, then you should definitely migrate to a Linux based hosting solution such as a VPS.

TL;DR:

Get a VPS, set up an API server, get statistics from that. There probably is no tutorial for you to follow.

Axisnix
  • 2,822
  • 5
  • 19
  • 41