This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
technomancer21's profile picture

Server RAM usage monitor program

Started by technomancer21, 07 May 2014 - 07:53 AM
technomancer21 #1
Posted 07 May 2014 - 09:53 AM
Hey guys, I'm fairly new to this LUA scripting and to be completely honest, I dont even know where to begin with this, Not even sure if i'm posting in the right forum, If i'm in the wrong place could a mod please move the thread?

I've seen bukkit plugins that report the current RAM usage of the server they are installed on and I wondered if it might be possible to do something similar with a computer, and display the current RAM usage as a percentage on a large monitor in game.

If a bukkit plugin can gather and relay such data to someone who inputs a server command, can a computer not find and relay the same data and refresh the display every five minutes?

Its for a server I play on that has limited ram, 1.5gb, and everyone is always jumping up and down about crashing the server simply because they cannot tell how much is in use. only the admin can and he has his hands full elsewhere, often doesn't have time to check it for us.

Any advice at all would be helpful if someone here knows of something that might help please. :D/>
CometWolf #2
Posted 07 May 2014 - 08:17 PM
Only way this would be doable was if the server reported it's ram usage on a http website, which the computer could then retrieve the information from. However, this is just plain silly. Tell the admin to add the permission node "essentials.gc" to everyone. It's what enables him to check it.
viluon #3
Posted 07 May 2014 - 08:30 PM
A good place to start with Lua is definitely Programming In Lua (freely available online here http://www.lua.org/pil/contents.html )
technomancer21 #4
Posted 09 May 2014 - 08:49 AM
So you are telling me, that there is no way I can code a program to periodically check the ram usage by collecting the same data that a bukkit plugin I have seen in action does?
Because that same bukkit plugin never needed any HTTP URLs or login details, it retrieved the information straight from the java instance if I recall rightly.

As for essentials.gc node, this is a modpack server, not bukkit. It doesn't have essentials, therefore there is no such permissions node nor even a permissions manager to allow players access to it.
Lyqyd #5
Posted 09 May 2014 - 03:23 PM
You'd need a peripheral mod if you wanted to get that sort of data. No such mod exists, so you'd need to code one.
CometWolf #6
Posted 09 May 2014 - 04:11 PM
Modpack servers can run bukkit just fine, or well mcpc+, but the result is the same. But yeah, that's what we're telling you. The computercraft computer can't interact with the server machine in any way by default.
technomancer21 #7
Posted 09 May 2014 - 04:50 PM
Well That puts a damper on my day. But thank you all for your help. I'll see about other options maybe. Cheers though. :D/>
blipman17 #8
Posted 10 May 2014 - 07:03 AM
The peoblem is that cc is sandboxed, but it can use the iternet. If you get a plugin that shows the serverdata on the internet it could get its data from there
Edited on 10 May 2014 - 05:03 AM
viluon #9
Posted 10 May 2014 - 09:08 AM
The peoblem is that cc is sandboxed, but it can use the iternet. If you get a plugin that shows the serverdata on the internet it could get its data from there
True but inefficient, creating a custom peripheral would be much better (in terms of both speed and server CPU load)
1vannn #10
Posted 11 May 2014 - 05:32 PM
You can have a Linux box with a PHP script that shows stats, and have the ComputerCraft program to grab the content from the website.