jmessage, jtool message
A platform agent tool used to send an operator message.
This tool cannot be used outside job-context, so the -j
or -job-context
parameter is implied. As with all job-context operations, the update is performed asynchronously so there is no guarantee that the operation will succeed in the server.
As the operator message is logged in job-context, you will find that the operator message is linked to the process and can be accessed both from the process details and the operator message monitor.
Syntax
jmessage [-h|-?|-help] [-l <loglevel>] [-f <logfile>] -j|-job-context [-stderr] [-stdout] [-log]
[-log-with-level <loglevel>] <message> ...
Argument | Description |
---|---|
-h,-?,-help | Show this help and exit. |
-l <loglevel> | Set the logging level. |
-f <logfile> | Log to file instead of stdout/stderr. |
-j, -job-context | Run the command in job-context. |
-stderr | Send message also to stderr. |
-stdout | Send message also to stdout. |
-log | Write to stdout or stderr in standard log format. |
-log-with-level <loglevel> INFO | Set loglevel for -log option. |
<message> | Message text |
Example
Create Operator Message
An example Microsoft Windows CMD script to show how you can raise awareness of errors beyond just logging them in output files.
dir g:
if errorlevel 1 jmessage "Drive G: not accessible!"
Suppress Operator Message
An example Bash script to test 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