Skip to content

MCP Server Resource and Environment Tools

get_server_resources and get_environment show the engine a model is working with: how hard it is working, and what it runs on. Both are for administrators only. Neither changes anything.

Server resources

get_server_resources returns how hard each running HA node is working, or the one node instance names:

Member Holds
memoryPools Each memory pool's used, committed, maximum and peak size, in megabytes; a maximum of -1 means the pool has none
garbageCollectors Each garbage collector's number of collections and total collection time in milliseconds since the JVM started
cpuPercent The JVM's CPU use, the whole server's, and the load average per core, as percentages
threadPools The processor, completion and logger thread pools: threads, work queued and throughput
openFiles Open files against the limit, where the operating system reports them; Windows does not, so it is left out there

The node that answers the call reads its own figures at that moment. Every other node's figures are the ones it stored with its last heartbeat, and readingsAt says when that was. thisNode names the node that answered.

The garbage collection figures are totals since the JVM started, so one call cannot say how fast they grow. Two calls a minute apart can: collection time that grows by a large share of that minute means the JVM spends much of its time collecting rather than processing.

Environment

get_environment returns what the engine runs on, so a model can check whether something changed before a problem began:

Member Holds
nodes Each running HA node's Java vendor, version and home, operating system and version, QIE version, server name and address, QIE home folder, last heartbeat, and database dialect, driver and connection URL
recentStarts The 20 newest node starts, newest first, with the same versions and whether each node stopped, shut down cleanly or was recovered by another node; a Java, operating system or QIE version that differs between two starts shows when it changed
externalLibraries The node's external libraries (see External Libraries), each with whether it is selected to load and the version its JAR's manifest declares
jvmArguments The arguments the node's JVM started with
qieOptionsFromEnvironment The QIE options set through environment variables, the same values qieJavaArguments.txt lists; the rest of the environment is left out
haLocks On an HA cluster, which node holds each channel's receiver, sender and scheduled script lock, with any takeover asked for, and which node holds each cluster job
recentSystemEvents The 25 newest system events, the requests QIE records for its nodes to carry out, newest first, with their type, user and the node each was for

externalLibraries, jvmArguments and qieOptionsFromEnvironment are those of the node that answers the call: other nodes do not store them. System events are listed without their times.

Secrets are masked

QIE replaces these values with {value_masked} before it returns them:

  • The value of every Java option QIE marks secret, such as connection.password and the database encryption key qie.longKey, and of the QIE_DB_PASS_ENCRYPTION_KEY environment variable.
  • The value of any argument or option whose name or value holds a word such as pass, pwd, secret, token, auth, credential, apikey, accesskey, privatekey or signingkey, ignoring case and punctuation, so api_key and API-KEY count.
  • The password in a URL written as user:password@host, wherever it appears, including the database connection URL.
  • In jvmArguments, the value of every -D system property that is neither one of QIE's Java options nor one of the JDK's own, whose names start with java., javax., jdk., sun., com.sun., file., user., os., line. or path.. A third party's name, such as an APM agent's setting, cannot show whether its value is a secret. The options a Java agent is loaded with, after the first = of -javaagent:, -agentpath: or -agentlib:, are masked for the same reason. The name of each masked property is still listed.

QIE masks the values in the first three items in the log files that list them as well (see Masked values). The last item applies only to what the MCP returns: the files on the server keep those values, for an administrator there. When read_engine_log returns qieJavaArguments.txt or one of its numbered backups, or one of the Windows installer's copies of the service's Java options and arguments (the installerBeforeJava... and installerAfterJava... files), it masks each option as get_environment does. In every other log it masks the options on the command the launcher starts QIE with and on the line in which Java reports the options it picked up from JAVA_TOOL_OPTIONS, JDK_JAVA_OPTIONS or _JAVA_OPTIONS. The launcher's list of environment variables keeps the values of the variables QIE reads, masked as above, and shows the value of every other variable, such as PATH or JAVA_HOME, as {value_masked}, because get_environment leaves those variables out. The same holds for the engine's own list, which the launcher's log copies from the engine's output. A log too long to return whole comes back as its end only, and its first line, which starts part way through an entry, is shown as {value_masked}.

Through the Hub

Both tools can run across a Hub tag, as well as at one site (see Site Tools on a Hub).