asadmin> set-rest-monitoring-configuration --enabled=true
Configuring REST monitoring
REST monitoring is configurable through asadmin commands. This feature is in technical preview, so some things may not work quite as intended.
Setting REST monitoring Configuration
The set-rest-monitoring-configuration asadmin command is used to configure
REST monitoring. This command requires the server to be running. Each
configuration property can be configured individually or all together.
Enabled
By default, REST monitoring is disabled.
Target
asadmin> set-rest-monitoring-configuration --enabled=true --target=${Target}
If no target is specified, the command will enable REST monitoring on the
domain configuration (server-config). The --target option enables
REST monitoring on another instance or cluster.
Context Root
asadmin> set-rest-monitoring-configuration --contextroot=${ContextRoot}
The contextroot property defines which URL the REST monitoring application
uses. The context root of the REST monitoring application defaults to
/rest-monitoring, but can be changed using the --contextroot option.
Name
asadmin> set-rest-monitoring-configuration --name=${Name}
The name property defines the name of the deployed REST monitoring
application. This option defaults to "__restmonitoring".
Security Enabled
asadmin> set-rest-monitoring-configuration --securityenabled=true
The securityenabled property defines whether the REST monitoring application
is available over HTTPS. Since the REST monitoring application is hosted on the
admin-listener, this requires secure admin to be enabled.
Enabling secure admin can be done by first configuring the admin password with
the change-admin-password command, then using the enable-secure-admin
command. Enabling secure admin requires a server restart.
When securityenabled is set to true, a username and password is required to
use REST monitoring. By default the username is set to payara and the password
is set to rest. The user payara is defined in the file realm.
The password can be changed with the following command:
asadmin> update-file-user --groups=rest --target=server-config --authrealmname=file payara
This updates the payara user, which is part of the rest group. Any users who
are able to log in to the REST monitoring must also be defined in the file
realm and be part of the rest group.
New users can be created by using the following command:
asadmin> create-file-user --groups=rest --target=server-config --authrealmname=file ${username}
Getting REST monitoring Configuration
asadmin> get-rest-monitoring-configuration
The get-rest-monitoring-configuration asadmin command is used to get the
configuration of the REST monitoring. This command requires the server to be
running.
If no target is specified, the command will get the REST monitoring
configuration from the domain configuration (server-config). The --target
option retrieves the REST monitoring from another instance or cluster.
- Example
asadmin> get-rest-monitoring-configuration --target server-config Enabled Rest Monitoring Application Name Context Root Security Enabled true __restmonitoring /rest-monitoring false