jmessage, jtool message
You can use jmessage
to send an Operator Message.
Note: This tool cannot be used outside of job context. The -j
or -job-context
parameter is implied.
As with all job-context-dependent operations, the update is performed asynchronously, so there is no guarantee that the operation will succeed on the server.
Because the Operator Message is logged in job context., the Operator Message is linked to the process and can be accessed both from the process details and the Operator Message monitor.
Note: For installation instructions, see jtool
.
Syntax
jmessage [-h|-?|-help] [-l <loglevel>] [-f <logfile>] -j|-job-context [-stderr] [-stdout] [-log]
[-log-with-level <loglevel>] <message> ...
Argument | Description |
---|---|
-h,-?,-help | Shows the help. |
-l <loglevel> |
Sets the log level. |
-f <logfile> |
Logs to a file instead of stdout and stderr . |
-j, -job-context | Gets the environment from the job context. |
-stderr | Also sends the Operator Message to stderr . |
-stdout | Also sends the Operator Message to stdout . |
-log | Writes to stdout or stderr in standard log format. |
-log-with-level <loglevel> INFO |
Sets the log level for the -log option. |
<message>
|
The text of the Operator Message. |
Examples
Creating an Operator Message
This example Windows CMD script shows how you can raise awareness of errors beyond just logging them in output files.
dir g:
if %ERRORLEVEL% 1 jmessage "Drive G: not accessible!"
Suppressing an Operator Message
This example BASH script tests a PEM key stored in a parameter (you would not want a Operator Message to contain a password). If the PEM key is stored in a credential, you can use =Credential.getProtectedPassword('MY_ENDPOINT', 'MY_USER')
to retrieve it.
jtool message -j -out -fix-pem '${MY_PASSWORD}' > my_password.txt
if grep -q - '--BEGIN' my_password.txt
then
echo "Testing for PEM key validity"
openssl rsa -noout -modulus -in my_password.txt
fi