Administrative command-line interface
Overview
You can use the administrative nevisIDM command-line interface (CLI) to create and manage instances of nevisIDM. The command-line interface consists of the following commands:
Static commands
nevisidm pkgPrints out the current component version.
nevisidm instLists instances.
nevisidm inst create <instance>Creates a new instance, by creating a directory under
/var/opt/nevisidm, copying template files from/opt/nevisidm, and replacing the variables in the template. Registers the component instance as a service insystem.d.Uses
key=valuecommand line arguments for the variable replacement in the template files. Uses theINST_CUSTOM_TEMPLATE=<path>command line argument to provide custom configuration templates.nevisidm inst exists <instance>Checks the existence of the instance directory.
nevisidm inst remove <instance>Stops the running instance.
Creates a backup of the instance, by zipping the instance directory. Removes the instance directory
/var/opt/nevisidm/<instance>. Removes thesystem.dservice entries.
Instance commands
nevisidm <instance> startStarts instance via
system.d.nevisidm <instance> stopStops instance via
system.d.nevisidm <instance> restartCalls stop and start.
nevisidm <instance> statusShows the aggregate status of the instance.
nevisidm <instance> configEdits the application configuration.
nevisidm <instance> config envEdits the environment configuration.
nevisidm <instance> config vmargsEdits the configuration file containing the JVM arguments. This is an alias of the
config envcommand.nevisidm <instance> config logEdits the log configuration.
nevisidm <instance> config serverEdits the instance server configuration.
nevisidm <instance> logLists the server log files.
When you execute a command without specifying the instance name, the command is performed against the default
nevisidminstance.
Setting up servers
The base command for creating an instance is:
nevisidm inst create <name>
This will create an instance using default settings for all configurations. Depending on your requirements or environment this might not result in a working setup out of the box.
The template files for configuration can be found at /opt/nevisidm/template/conf.
Overriding default variables from command line arguments
To use values specific to your requirements, you can provide key=value pairs in the command line after the instance name:
nevisidm inst create <instance> INST_CUSTOM_TEMPLATE="/tmp/my_templates" IDMDB_USERNAME="UIDM03"
The default teamplates do not contain such variables. Define custom templates to use this functionality.
Overriding default variables from files
A properties file can be used to store and override multiple variables. A properties file can be leveraged like this:
nevisidm inst create <instance> /tmp/setup.properties
Where the /tmp/setup.properties contains key value pairs like this:
INST_CUSTOM_TEMPLATE=/tmp/my_templates
IDMDB_USERNAME=UIDM03
The values specified in command line arguments will overwrite variables defined in a properties file.
All files ending with *.properties will be loaded.
Using custom templates
You can provide your own templates if the default configuration templates do not suit your needs.
This can be done via the INST_CUSTOM_TEMPLATE command line argument, where you define a directory containing your templates.
The inst create command will always:
- Copy the default template files from
/opt/nevisidm/templateto/var/opt/nevisidm/<instance>/ - Copy template files found under the
INST_CUSTOM_TEMPLATEto/var/opt/nevisidm/<instance>/ - Replace
@VARIABLE@in all non binary files in the/var/opt/nevisidm/<instance>/director.
Example for using all three features together:
nevisidm inst create <instance> INST_CUSTOM_TEMPLATE=/tmp/testtemplate/ OTHERCOMMANDLINEVARIABLE=myvalue /tmp/setup.properties
Note that templates are not restricted to the configuration files, but everything under the instance directory.
Controlling the server
You can use all, to execute commands on all instances.
nevisidm <instance> startUses the
system.dservice to start the server process, if it is not already running. The command will wait up to 1 minute, for the ports to be bound for the process, then it shows the status.nevisidm <instance> stopStops the
system.dservice.nevisidm <instance> restartPerforms a stop command, followed by a start command.
nevisidm <instance> statusDisplays basic information on the current runtime state of the server.
# nevisidm status
--------------------------------------------------------------------------------
Status : UP
instance : nevisidm
Process ID : 26618
Ownership : nvauser / nvbgroup
Network port(s) : localhost:8998
: *:8989
Filedescriptors : 1024
Logfile(s) : /var/opt/nevisidm/nevisidm/log/batch.log
/var/opt/nevisidm/nevisidm/log/application.log
/var/opt/nevisidm/nevisidm/log/audit-json.log
/var/opt/nevisidm/nevisidm/log/audit.log
--------------------------------------------------------------------------------
Configuration editing
Configuration editing is usually not an every day administration task and is not required for operation. In production, manual changes of parameters should only be done in emergency cases and only by experienced staff who knows exactly about the effect of such changes.
These commands use either the editor defined in EDITOR environment variable or in case that is not set vim. If vim is not available then vi is used.
nevisidm <instance> configOpens the main configuration file
/var/opt/nevisidm/<instance>/conf/nevisidm-prod.propertiesfor editing. Changing the configuration requires a server restart.nevisidm <instance> config envThis command allows specifying arguments to be passed to the JVM initialization, the
JAVA_OPTS. It opens the configuration file/var/opt/nevisidm/<instance>/conf/env.conffor editing. Changing the configuration requires a server restart.nevisidm <instance> config vmargsThe command behaves exactly the same as the
config envcommand and exists only for legacy purposes.nevisidm <instance> config logLog4j configuration.
nevisidm <instance> config rolesMapEdits
/var/opt/nevisidm/<instance>/conf/rolesMapping.properties, wher the fine-grained permissions are defined.nevisidm <instance> config rolesAssignEdits the configuration file
/var/opt/nevisidm/<instance>/conf/rolesAssignment.properties, which defines which nevisIDM role is allowed to assign which other nevisIDM role.nevisidm <instance> config rolesAuthEdits the configuration file
/var/opt/nevisidm/<instance>/conf/authorizationConfig.properties, where the definition of privilege escalation can be found.