This documentation supports the 20.02 (12.0) version of BMC Discovery.

To view an earlier version of the product, select the version from the Product version menu.

Discovering content from hosts

You can discover content from hosts by using data sources. For example, you might use a data source to retrieve a file, a directory listing, or a registry key. For VMware ESX and ESXi hosts, you might want to discover information about the VMware ESX and ESXi hosts through vCenter or by directly using the vSphere API.At the time of release of BMC Discovery 20.02 (12.0), the following host access data sources were provided. Additional host access data sources may be added in subsequent TKUs:

  • SSH
  • Windows
  • vCenter
  • vSphere

To discover content from hosts

The basic method to discover content from hosts is:

  1. Configure the host data source.
  2. Write a pattern that specifies: 
    1. The data source by name.
    2. A query to access the required information.
  3. Upload and activate the pattern.
  4. Scan the endpoint.

Queries

The query can be any one of the host discovery functions that retrieve information, or files. For example:

To retrieve a file from a UNIX or Linux (SSH) host

This procedure shows how to retrieve a file from a UNIX or Linux host by using an SSH data source. The principles for other host data sources are identical, though you need to make minor modifications, for example, for paths on Windows hosts running an SSH server.

  1. To create an SSH data source, from the main menu, select Manage > Data Sources.
  2. Click Add and select SSH from the menu.
  3. To add a data source, see Adding data sources.
    The following are example parameters:
    • Name—the name of the data source. For example, "SSH tideway DS". This is how patterns refer to and use the data source. 
    • Endpoint—the address (IPv4 or IPv6) of the host, or a resolvable hostname.
    • Description—a free text description that is displayed on the Data Sources page.
    • Username—the username with which to access the host.
    • Password—the corresponding password.
    You might also need to add any parameters specific to the data source type. In this example, you might choose to use an SSH key, or specify an additional user with elevated privileges (SU User).
  4. Write a pattern that uses the data source you created and a query:
    1. Specify the data source:

      ds_host := discovery.dataSource("SSH tideway DS");
    2. Specify the query: 

      \\ returns the file from the specified file on the host
      file := discovery.fileGet(ds_host, "/home/tideway/Tests/filetest.txt");
      
      \\ returns the file information from the specified file on the host
      fileinfo := discovery.fileInfo(ds_host, "/home/tideway/Tests/filetest.txt");
      
      \\ returns a directory listing from the host
      dirlist := discovery.listDirectory(ds_host, "/home/tideway/Tests");
  5. Upload and activate the pattern.

  6. Scan the host.

To retrieve a registry key from a Windows host

This procedure shows how to retrieve a registry key from a Windows host by using a Windows data source. 

  1. To create a Windows data source, from the main menu, select Manage > Data Sources.
  2. Click Add and select Windows from the menu.
  3. For details on how to add a data source, see Adding data sources.
    The following are example parameters:
    • Name—the name of the data source. For example, "Windows tideway DS". This is how patterns refer to and use the data source. 
    • Endpoint—the address (IPv4 or IPv6) of the host, or a resolvable hostname.
    • Description—a free text description that is displayed on the Data Sources page.
    • Username—the user name with which to access the host.
    • Password—the corresponding password.
  4. Write a pattern that uses the data source you created and a query:
    1. Specify the data source:

      ds_host03 := discovery.dataSource("WINDOWS tideway DS");
    2. Specify the query:

      \\ returns the specified registry key
      \\ Note the escaping of \0 -> \\0 in the key specification
      result05 := discovery.registryKey(ds_host03, "HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\\0\Identifier");
      
      \\ list the specified registry
      result06 := discovery.listRegistry(ds_host03, "HKEY_LOCAL_MACHINE\SOFTWARE");
      
  5. Upload and activate the pattern.

  6. Scan the host.

To retrieve information on a vSphere object from a vCenter managed host or vSphere API

This procedure shows how to retrieve attributes for a selected ManagedObjectReference (MOR). The principles for other host data sources are identical, though you need to make minor modifications, for example, for paths on Windows hosts running an SSH server.

  1. To create a vCenter or vSphere  data source, from the main menu, select Manage > Data Sources.
  2. Click Add and select vCenter or vSphere from the menu.
  3. For details on how to add a data source, see Adding data sources.
    The following are example parameters:
    • Name—the name of the data source. For example, "VSPHERE tideway DS" or "VCENTER tideway DS" . This is how patterns refer to and use the data source. 
    • Endpoint—the address (IPv4 or IPv6) of the host, or a resolvable hostname.
    • Description—a free text description that is displayed on the Data Sources page.
    • Username—the user name with which to access the host.
    • Password—the corresponding password.

  4. Write a pattern that uses the data source you created and a query:
    1. Specify the data source:

      ds_VShost := discovery.dataSource("VSPHERE tideway DS");
    2. Specify the query: 

      \\ returns the name and summary.config.port from the HostSystem MOR:
      result10 := discovery.vSphereFindObjects(ds_VShost , "HostSystem", ["name", "summary.config.port"]);
  5. Upload and activate the pattern.

  6. Scan the host.

To view the information discovered

You can see the data source accesses for each discovery run that uses data sources. To do this:

  1. From the Discovery Access section in the Host page, click the latest Discovery Access.
  2. From the top row of the Endpoint section, select the Discovery Run.
  3. From the Status section, select  n Data Source Accesses Related.  
    The Data Source Access List page is displayed. If there is only one, the Data Source Access page is displayed.
  4. Select the Data Source Access you want to view. 

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

Comments