Important

   

This space contains documentation for TrueSight Server Automation 8.9.03 and the later service packs for 8.9. For earlier releases, see BMC Server Automation 8.9.

Learning how to run your first BLCLI command

Before you run your first BLCLI command, ensure that you understand the concepts of format and authentication. The following topics provide more information about these concepts:

Formatting a BLCLI command

Format all your BLCLI commands according to the following convention:
blcli [Command Options] <Name Space> <Command Name> [Argument1] ... [ArgumentN]

Example

blcli Server addServer myNewServer

A BLCLI command contains the following elements:

  • [Command Options] — Optional; described in BLCLI command options.
  • <Namespace> — Identifies a grouping of related commands, such as Component or AuditJob.
  • <Command Name> — Unique identifier for a command with a given namespace.
  • [Argument1] ... [ArgumentN] — List of arguments that you can supply for each command. You must supply a value for all arguments for each command. If an argument contains special characters, it is recommended that you enclose it in double quotes; for example, paths that contain space characters or properties that end with an asterisk.

Setting up authentication

BMC Server Automation uses a variety of security protocols for authenticating against the Application Server. Administering security covers these security implementations and concepts in detail.

Before you can run a BLCLI command, you must set up authentication. There are many ways to authenticate. This tutorial uses the following simple methods:

Creating a service profile

The following example shows how to create a service profile with the following values:

  • Name of the service profile = myServiceProfile
  • Host name of the computer running the Application Server = machine1
  • Authentication service port on that machine = 9840
    (This is the default port for the authentication service.)
  • Authentication type = SRP

Example

Type the following line at a command prompt, substituting appropriate values for your environment.
blcred authprofile -add -profile myServiceProfile -host machine1:9840 -type SRP

If you specify the host name as an IPv6 address, enclose the IPv6 address in square brackets. For example, [2001:db8::1:2]. For an IPv6 address, if you run the command through the Network Shell (NSH), enclose the server:port string in double quotes. For example, "[2001:db8::1:2]:389".

Populating the credentials cache

Now you need to populate the credentials cache. The following example shows how to populate the credentials cache with the following values:

  • Name of the service profile = myServiceProfile
  • BMC Server Automation user name = Admin1
  • BMC Server Automation password = myPassword

Example

Type the following line at a command prompt, substituting appropriate values for your environment.
blcred cred -acquire -profile myServiceProfile -username Admin1 -password myPassword

Running your first command

After you have completed the steps in Setting up authentication, you have a valid service profile and role. In this example:

  • Name of the service profile = myServiceProfile
  • Name of the role = BLAdmins

You can now run your first BLCLI command at the CLI.

Syntax notes

The example uses the -v command option to specify the name of a service profile, and the -r command option to specify a role. For a complete list of command options, see BLCLI command options.

Examples

If you are in an environment with a relatively small number of enrolled servers*, you can list all the enrolled servers by typing:
blcli -v myServiceProfile -r BLAdmins Server listAllServers
The output should be a list of servers, for example:
server1server2

If you are in an environment with a large number of enrolled servers*, for performance reasons, you might want to try one of these commands instead:

  • blcli -v myServiceProfile -r BLAdmins JobManagement getJobManagerFullStatus
  • Assuming you have a server with the hostname server1:
    blcli -v myServiceProfile -r BLAdmins Server printAllProperties server1

Where to go from here

Now that you have run your first command, you can take a look at using commands within a script. See Using BLCLI commands within an NSH script.

Was this page helpful? Yes No Submitting... Thank you

Comments