arkmanager / ark-server-tools

Set of server tools used to manage ARK: Survival Evolved servers on Linux
MIT License
680 stars 144 forks source link

Suggestion: Less verbose status in table format? #1117

Open TheRealestMVP opened 4 years ago

TheRealestMVP commented 4 years ago

Currently the status @all command lists instances as follows:

Running command 'status' for instance 'island1'
 Server running:   Yes 
 Server PID:   18605 
 Server listening:   Yes 
Server Name: Example Server Name
Players: 10 / 50
Active Players: 10
 Server online:   Yes 
 ARKServers link:   http://arkservers.net/server/1.2.3.4:1234 
 Steam connect link:   steam://connect/1.2.3.4:1234
 Server build ID:   5184929 
 Server version:   311.209 
Running command 'status' for instance 'island2'
 Server running:   Yes 
 Server PID:   18607 
 Server listening:   Yes 
Server Name: Example Server Name
Players: 8 / 50
Active Players: 8
 Server online:   Yes 
 ARKServers link:   http://arkservers.net/server/1.2.3.4:1235 
 Steam connect link:   steam://connect/1.2.3.4:1235
 Server build ID:   5184929 
 Server version:   311.209 
Running command 'status' for instance 'island3'
 Server running:   Yes 
 Server PID:   18609 
 Server listening:   Yes 
Server Name: Example Server Name
Players: 12 / 50
Active Players: 12
 Server online:   Yes 
 ARKServers link:   http://arkservers.net/server/1.2.3.4:1236
 Steam connect link:   steam://connect/1.2.3.4:1236
 Server build ID:   5184929 
 Server version:   311.209 
[ ... and many more ... ]

The indentation is inconsistent, and it makes it very hard to get a good overview of your servers status, players, and versions when you have many instances. I run a cluster with 16 instances and it's quite hard to get a good overview at a quick glance.

How about a shorter status overview, less verbose and in table form, like this:

Instance    Running  PID    Listening  Players   Online   Build ID   Version
@island1    Yes      18605  Yes        10 / 50   Yes      5184929    311.209
@island2    Yes      18607  Yes         8 / 50   Yes      5184929    311.209
@island3    Yes      18609  Yes        12 / 50   Yes      5184929    311.209
[ ... and more, one instance per line ... ]

This gives the most relevant information for a server admin to quickly check if servers are running, are up to date, and how many players are active without having to dig through too much output.

Could be a separate command, or a switch for the "status" command.

I tried it myself using a wrapper script, but gave up since me and shell scripting will never be friends, apparently.

TheRealestMVP commented 4 years ago

I couldn't stop thinking about this and actually made a wrapper script in Perl that does what I want. Here's a sample output:

--------------------------------------------------------------------------------
 Instance                  PID    CPU    RSS   Lst   Players   Build    Version 
--------------------------------------------------------------------------------
 @aberration1            10746  11.8%   6,1G   Yes    5 / 50   5184929  311.209 
 @aberration2            21000  12.1%   5,9G   Yes   12 / 50   5184929  311.209 
 @crystal1                5551  42.6%   8,5G   Yes    6 / 50   5184929  311.209 
 @extinction1            21690  13.4%   6,9G   Yes    5 / 50   5184929  311.209 
 @extinction2            18608  15.8%   6,4G   Yes    0 / 50   5184929  311.209 
 @genesis1                2003  33.1%   7,1G   Yes    5 / 50   5184929  311.209 
 @genesis2               10881  38.8%   7,9G   Yes    1 / 50   5184929  311.209 
 @genesis-training           -      -      -    No         -   5153677  311.79 
 @island1                18605  14.8%   6,4G   Yes   21 / 50   5184929  311.209 
 @island2                10285  16.4%   5,9G   Yes    7 / 50   5184929  311.209 
 @island3                 2340  11.8%   6,1G   Yes   12 / 50   5184929  311.209 
 @island-training            -      -      -    No         -   5153677  311.79 
 @ragnarok1               1963  19.7%   7,4G   Yes   14 / 70   5184929  311.209 
 @ragnarok2              12885  18.4%   8,5G   Yes    8 / 70   5184929  311.209 
 @scorched1              22328  11.1%   4,4G   Yes    0 / 50   5184929  311.209 
--------------------------------------------------------------------------------

However, this would be great to have as a built-in arkmanager feature. If you have many instances it's a much, much clearer view than the cluttered default output.

As a bonus, I added memory and CPU usage for the PID.

If anyone is interested, here's the script: arkstatus.txt (remove txt extension and chmod +x, or rename to .pl) Warning: This is noobish quick&dirty Perl with no error handling and only tested on Debian 10, from a guy who doesn't code a lot. Use at own risk.