get_targets

Gets status and alert information for targets.

Standard Mode

emcli get_targets
        [-targets="[name1:]type1;[name2:]type2;..."]
        [-alerts]
        [-noheader]
        [-script | -format=
                           [name:<pretty|script|csv>];
                           [column_separator:"column_sep_string"];
                           [row_separator:"row_sep_string"];
        ]
        [-limit_rows="maximum_targets_to_be_retrieved"]
        [-config_search="configuration_search_UI_name"]
        [-unmanaged]
        [-properties]
        [-separator_properties="properties_sep_string"]
        [-subseparator_properties="properties_subsep_string"]

[ ]  indicates that the parameter is optional

Interactive or Script Mode

get_targets
      [(targets="[name1:]type1;[name2:]type2;..."]
      [,alerts=True|False]
      [,noheader=True|False]
      [,script=True|False | ,format=
                 [name:<pretty|script|csv>];
                 [column_separator:"column_sep_string"];
                 [row_separator:"row_sep_string"];
      ]
      [,-limit_rows="maximum_targets_to_be_retrieved"]
      [,-config_search="configuration_search_UI_name"]
      [,-unmanaged]
      [,-properties]
      [,-separator_properties="properties_sep_string"]
      [,-subseparator_properties="properties_subsep_string"])

[ ]  indicates that the parameter is optional

Options

  • targets=name:type

    Name or type can be either a full value or a pattern match using %. Also, name is optional, so the type can be specified alone.

  • alerts

    Shows the count of critical and warning alerts for each target. In scripting and interactive mode, the value needs to be set to either True or False.

  • noheader

    Display tabular output without column headers. In scripting and interactive mode, the value needs to be set to either True or False.

  • script

    This is equivalent to -format="name:script". In scripting and interactive mode, the value needs to be set to either True or False.

  • format

    Format specification (default is -format="name:pretty").

    • format="name:pretty" prints the output table in a readable format not intended to be parsed by scripts.

    • format="name:script" sets the default column separator to a tab and the default row separator to a newline. The column and row separator strings can be specified to change these defaults.

    • format="name:csv" sets the column separator to a comma and the row separator to a newline.

    • format=column_separator:"column_sep_string" column-separates the verb output by <column_sep_string>. Rows are separated by the newline character.

    • row_separator:"row_sep_string" row-separates the verb output by <row_sep_string>. Rows are separated by the tab character.

  • limit_rows

    Maximum number of targets to be retrieved. This defaults to 2000 rows if not specified.

  • config_search

    The search UI name should be the display name of the configuration search.

  • unmanaged

    Gets unmanaged targets (no status or alert information).

  • properties

    Maximum number of targets to be retrieved. This defaults to 2000 rows if not specified.

  • separator_properties

    Displays unmanaged target properties with separator_properties.

  • subseparator_properties

    Displays unmanaged target properties with subseparator_properties.

Output Columns

Status ID, Status, Target Type, Target Name, Critical, Warning

Examples

These examples show name and type information for unmanaged host targets.

Example 1- Command-Line

emcli get_targets
      -targets="host"
      -unmanaged

Example 2 - Scripting and Interactive

get_targets    (targets="host"    ,unmanaged)

These examples show name, type, and properties for unmanaged host targets with the specified separators. By default, the separator_properties is ";" and the subseparator_properties is ":".

Example 3 - Command-Line

emcli get_targets
      -unmanaged -properties 
      -separator_properties=, 
      -subseparator_properties==

Example 4 - Scripting and Interactive

get_targets
    (unmanaged -properties 
    ,separator_properties=, 
    ,subseparator_properties==)