Class StatusCli

java.lang.Object
com.forgerock.opendj.cli.Tool
org.opends.server.tools.status.StatusCli
All Implemented Interfaces:
Closeable, AutoCloseable

public final class StatusCli extends com.forgerock.opendj.cli.Tool
A tool which displays a server status.

Server status includes an overview of the following server components:

  • General (online/offline, host name and admin port, install/instance paths...)
  • Running JVM
  • Connection handlers
  • Replication Server
  • Backends
  • Base DNs
  • Disks usage

The tool can connect to either the local server if the --offline option is provided, (see StatusCli.LocalServerStatusProvider) or any online server, including the local one (see StatusCli.RemoteServerStatusProvider).
Information for the components listed above are collected from server configuration and from the monitor backend (i.e by querying cn=monitor whole subtree). Hence, only information collected from configuration are available in the offline mode.

By default, server status is printed on the Tool standard output with a human readable format. Status can also be printed in JSON format if the -s, --script-friendly option is provided.

  • Nested Class Summary

    Nested classes/interfaces inherited from class com.forgerock.opendj.cli.Tool

    com.forgerock.opendj.cli.Tool.Style
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Indicates whether the user has requested script-friendly output.
    static void
    main(String[] args)
    The main method for the status CLI tool.
    static int
    mainStatus(String[] args, PrintStream outStream, PrintStream errStream)
    Parses the provided command-line arguments and uses that information to run the status tool.
    com.forgerock.opendj.cli.ReturnCode
    run(String... args)
    Run this Tool tool with the provided arguments.

    Methods inherited from class com.forgerock.opendj.cli.Tool

    askPort, close, confirmAction, enableConsoleLoggingIfVerbose, errPrintln, errPrintln, errPrintln, errPrintlnSurroundedByBlankLines, errPrintVerboseMessage, flush, flushLogStream, getErrorStream, getErrStream, getInputStream, getOutputStream, isFullyInteractive, isQuiet, isVerbose, logVerboseMessage, mayPrompt, parseArguments, pressReturnToContinue, print, println, println, println, printlnNoWrap, printlnSurroundedByBlankLines, printNoWrap, readInput, readInput, readInputAllowEmpty, readLineOfInput, readPassword, readValidatedInput, readValidatedInputOrThrow, report

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • main

      public static void main(String[] args)
      The main method for the status CLI tool.
      Parameters:
      args - The command-line arguments provided to this program.
    • mainStatus

      public static int mainStatus(String[] args, PrintStream outStream, PrintStream errStream)
      Parses the provided command-line arguments and uses that information to run the status tool.
      Parameters:
      args - The command-line arguments provided to this program.
      outStream - The output stream to use for standard output, or null if standard output is not needed.
      errStream - The output stream to use for standard error, or null if standard error is not needed.
      Returns:
      The return code.
    • run

      public com.forgerock.opendj.cli.ReturnCode run(String... args) throws com.forgerock.opendj.cli.ClientException
      Description copied from class: com.forgerock.opendj.cli.Tool
      Run this Tool tool with the provided arguments. Output and errors will be written on the provided streams.

      This method can be used to run the tool programmatically.

      Overrides:
      run in class com.forgerock.opendj.cli.Tool
      Parameters:
      args - Arguments set to pass to the tool.
      Returns:
      0 if all processing completed successfully, or non-zero if an error occurred.
      Throws:
      com.forgerock.opendj.cli.ClientException - If an error occurs while running the tool.
    • isScriptFriendly

      public boolean isScriptFriendly()
      Description copied from class: com.forgerock.opendj.cli.Tool
      Indicates whether the user has requested script-friendly output. The default implementation returns false.
      Overrides:
      isScriptFriendly in class com.forgerock.opendj.cli.Tool
      Returns:
      true if the user has requested script-friendly output.