Skip to content

Configuration Guide

Raúl M edited this page Feb 8, 2022 · 3 revisions

This is the current configuration file as of AccurateReadings v1.2.0 (version currently in development)

# MAIN CONFIG FILE FOR ACCURATEREADINGS
# Last updated on AccurateReadings v1.2.0
# DO NOT forget ANY of the parameters, or it may result in a server crash.
# For more information, please read the wiki:
# https://github.com/sparkedhost/AccurateReadings/wiki/Configuration-Guide/


pterodactyl:
  # Should we normalize the CPU usage and limit values?
  # For example, if your server has a CPU limit of 300%, you may want to normalize this value to 100% to simplify things
  # What's the Pterodactyl panel URL?
  # Note: include the protocol in the URL. Do not add the trailing slash! Example: https://control.sparkedhost.us
  panel-url: "https://control.sparkedhost.us"
  # Generate the API key on your control panel.
  api-key: "CHANGETHIS"
  # The server ID to monitor
  server-id: ""
  # Should the plugin use a websocket for resource usage polling?
  # IMPORTANT NOTE: This is disabled by default as Pterodactyl (more specifically Wings) needs to be configured to allow
  # requests from any origin. Read more here: https://github.com/mattmalec/Pterodactyl4J/issues/24
  use-websocket: false

restart:
  # Should the plugin add the restart feature? It is experimental and may not always work. DEFAULT: false
  enabled: false
  # Should the plugin also broadcast a message to the entire server if successful? DEFAULT: false
  # NOTE: This has no effect if "enabled" is set false. You can customize the broadcast message below.
  announce-restarts: false

# Customization options for the /perf command or any of its aliases
perf-customization:
  # Command to run right after sending the stats, without the slash. DEFAULT: spigot:tps
  # The player or console that sends the /perf command will also execute this one, so make sure they're able to run it.
  # Leave blank for no command.
  post-command: "spigot:tps"

cooldown:
  # Pretty self-explanatory. This now comes disabled by default as the plugin no longer makes a request every single
  # time the command is run.
  enabled: false
  # Cooldown time in seconds. DEFAULT: 30
  time: 30

# --------------------------------------------------------------------------------------
# MESSAGES SECTION
# This allows you to customize the messages sent by the plugin to your liking.
# If any of these lines are left empty (""), the plugin will skip the message entirely.
# --------------------------------------------------------------------------------------

messages:
  # /perf message body
  # Valid placeholders:
  # - {CURRENTCPU} -> Prints current CPU usage, no % sign
  # - {MAXCPU} -> Prints CPU limit, no % sign
  # - {CURRENTRAM} -> Prints current memory usage, incl. units (MB or GB)
  # - {MAXRAM} -> Prints memory limit, incl. units (MB or GB)
  # - {CURRENTDISK} -> Prints current disk usage, incl. units (MB or GB)
  # - {MAXDISK} -> Prints disk limit, incl. units (MB or GB)
  # - {PLAYERCOUNT} -> Prints current amount of players
  # - {MAXPLAYERS} -> Prints total player slots available
  # - {SERVERID} -> Prints server ID being monitored
  # If empty, the plugin will use the default value. It will also log a warning in console to let you know.
  stats-message: |
    &8&m        &r &f&lSTATS&r &8&m        &r
    &r &r
    &6&l- CPU: &e{CURRENTCPU}% &7(limit: {MAXCPU}%)
    &6&l- RAM: &e{CURRENTRAM} &7(limit: {MAXRAM})
    &6&l- Disk: &e{CURRENTDISK} &7(limit: {MAXDISK})
    &6&l- Players: &e{PLAYERCOUNT}&7/&f{MAXPLAYERS}
    &6&l- Server ID: &e{SERVERID}
    &r &r

  # Will be displayed when the command sender does not have the required permission to run a command.
  no-permission: "&cYou do not have permission to execute this command."
  # The plugin will broadcast this message to the entire server whenever the restart command is used.
  # This only works with the restart feature of this plugin, and will only display this message if announceRestart is set to true.
  restart-broadcast: "&e&lTHE SERVER IS RESTARTING!"

# DO NOT change this, it's used internally within the plugin to determine the config version.
version: 1

pterodactyl section

panel-url

The URL to the control panel. It is where you would control your server normally. Please refer to the Installation Guide [to-do] in order to find it.

api-key

This is the API key, you will need to generate that on the control panel URL specified above.

server-id

The ID of the server. The API key you specified needs to have access to the server you want to monitor, the ID of which you'll need to specify here. Doesn't matter what kind of access you have (owner, subuser or admin account), as long as it's able to pull resource usage data from the panel. Although, in the case of subusers, you need to ensure the account is able to perform the actions required by this plugin.

perf-customization section

post-command

tbc

messages section

This contains a list of messages sent by the plugin that can be customized. More customization options might come in the future, but this should be plenty.

stats-message

/perf command body, tbc

api-key-not-owner

tbc

no-permission

Self explanatory, this will show up if the command sender doesn't have the necessary permission to run a command from this plugin.