Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 2. Assessing and filtering your inventory
Assessing and filtering your inventory will help you identify and eliminate security, operations, and business risks in your fleet.
2.1. Inventory Application Programming Interface (API) Copier lienLien copié sur presse-papiers!
Red Hat Insights provides a set of APIs that you can use to interact with specific Insights for Red Hat Enterprise Linux applications, to obtain system details and recommendations.
We have designed our APIs to ensure the security of your data. All Insights APIs are Representational State Transfer (REST) APIs. REST APIs are stateless. Statelessness means that servers do not save client data between requests. Our APIs also use token-based authentication, which provides granular control over access permissions and enhances security.
Review the following resources to learn more about how you can use the inventory API to locate information, enact edits, and automate repetitive tasks:
Additional Resources
For more information about Red Hat Insights API, see the Red Hat Insights API reference guide: API Catalog
For more information about getting started with Red Hat Insights API, see the Red Hat Insights API cheat sheet: Insights API cheat sheet
For more information about the inventory API, see Managed Inventory: Managed Inventory API
2.2. Refining your view of systems in inventory Copier lienLien copié sur presse-papiers!
There are several ways to refine your inventory view to help you focus on the issues and systems that matter the most. You can filter by Name, Status, Operating System, Data Collector, remote host configuration status, Last seen, Workspace, or Tags. Follow the procedure below to filter your systems:
Prerequisites
- You have Inventory Hosts viewer access.
Procedure
- Navigate to Red Hat Insights > RHEL > Inventory > Systems page.
- Click the Name filter drop-down. Choose an option from the drop-down menu, such as Name, Status, Operating System, Data Collector, RHC status, Last seen, Workspace or Tags.
- Select additional filters within your query. For example, if you chose the Operating System filter, click Filter by operating system in the header to choose a specific version of RHEL.
- Click the checkbox next to the RHEL version you want to filter.
- Optional: To add multiple filters to your query, click an additional filter (such as Data Collector). A second drop-down appears to the right of the Data Collector filter, called Filter by data collector.
- Choose the desired data collector. This first filter then appears just below the header. If desired, choose a second filter. You can apply all 8 available filters to your query.
- Click Reset filters to clear your query.
Additional Resources
For information about global filters, see the following:
2.3. Assigned system display names Copier lienLien copié sur presse-papiers!
Each system in your Red Hat Insights environment has an assigned display name that identifies that system within the Red Hat Hybrid Cloud Console. There are two ways to assign a display name to a system:
- Automatically — Red Hat Insights inventory assigns a default name to the system. Red Hat Insights receives the default name from a data collector, such as Red Hat Subscription Manager (RHSM), and applies it to the system.
- Manually — You create the display name and manually apply it to the system.
Once a system has an assigned display name, that name persists in the Red Hat Hybrid Cloud Console. Another application cannot overwrite the display name.
2.3.1. How data collectors automatically assign default names to systems Copier lienLien copié sur presse-papiers!
A data collector is a specific application or service responsible for sending host information, updates, or system profile data to Red Hat Insights inventory. For example, Red Hat Subscription Manager (RHSM) and Red Hat Satellite act as data collectors for Red Hat Insights.
A data collector can provide a default display name to Red Hat Insights during registration or a registration update. If the data collector does not provide a default name, Red Hat Insights uses the system fully qualified domain name (FQDN) as a default display name.
Each data collector that interacts with Red Hat Insights has an assigned priority. Red Hat Insights inventory uses the display name provided by the data collector with the highest priority. That means that the display name reported by a higher priority data collector overrides the display name set by a data collector with a lower priority.
Red Hat Insights ignores a display name provided by a lower priority data collector if a higher priority data collector has already set the display name. The system always shows the display name from the highest priority data collector and ignores the rest.
The following table shows the data collectors in order of priority.
| Priority | Data Collector | Description |
|---|---|---|
| 1 |
Red Hat Insights UI, | Manually assigned display names have the highest priority. |
| 2 |
|
These RHSM data collectors mirror display names from RHSM to Red Hat Insights. |
| 3 | default (any other data collector) | Default priority for all non-specific data collectors that provide a display name, such as Red Hat Discovery Tool or Red Hat Satellite. |
| 4 | no data collector | If no data collector provides a default display name, Red Hat Insights automatically assigns the Fully Qualified Domain Name (FQDN) as the system display name. |
Additional resources
2.3.2. Manually assigning a system display name Copier lienLien copié sur presse-papiers!
System display names that you assign receive the highest priority. This means that lower priority data collectors cannot override names that you set manually.
2.3.2.1. Setting the system display name by using the Red Hat Insights UI Copier lienLien copié sur presse-papiers!
Procedure
-
Navigate to
. The Systems page displays a list of all of the systems in your environment. - Click on the More options icon (⋮) for the system for which you want to set the display name.
- Select Edit display name from the drop-down menu. The Edit display name dialog box displays.
- Enter the name you want to assign to the system.
- Click Save to save the new display name.
2.3.2.2. Setting the system display name by using insights-client Copier lienLien copié sur presse-papiers!
-
To use
insights-clientto set the system display name, see Changing the host display name.
2.3.2.3. Setting the system display name by using the inventory API Copier lienLien copié sur presse-papiers!
-
To use the inventory API to set the system display name, issue the
PATCH /hosts/{host_id_list}API call. For more information about using an API call, see thehostssection in the Red Hat Insights host inventory API catalog.
2.4. Viewing and managing connected client systems that use Insights proxy Copier lienLien copié sur presse-papiers!
Red Hat Insights can identify systems that communicate through a proxy server. This helps you to ensure that all systems are routed through the proxy server in disconnected environments. You can manage connectivity in your environment from a single point.
When you use the configure-client.sh script to configure systems to use the Insights proxy, the script uses the Insights system tagging capability to identify the proxy server on the client systems. For more information about how to run the configure-client.sh script, see Configuring client systems.
The script adds an entry in the /etc/insights-client/tags.yaml file on the client system that tags the proxy server. The entry takes the following format:
insights-proxy: <rhproxy-hostname>
insights-proxy: <rhproxy-hostname>
For example, a client system that connects to the server myproxy.example.com could have the following line added to the tags.yaml file. In this example, myproxy.example.com has the hostname myproxy-example in Insights inventory.
insights-proxy: myproxy-example
insights-proxy: myproxy-example
When a client system uses a proxy server to communicate with Insights, you can view the proxy server in inventory in the Hybrid Cloud Console. The Filter by tags filter displays the proxy server tag grouped under the insights-client heading. You can select the proxy server tag to view the client systems connected to it. For more information about how tagging works, see Custom system tagging.
After you configure the client system to use a proxy server, insights-client must perform an upload to Insights before the server can be identified by tag in inventory.
If the proxy server for a client changes, re-run the configure-client.sh script. The script correctly handles the reconfiguration entry in the /etc/insights-client/tags.yaml file.
Additional resources
2.4.1. Disabling the proxy connection on the connected client systems Copier lienLien copié sur presse-papiers!
If you decide to stop using the Insights proxy, see Unconfiguring client systems when you want to disable the Insights proxy. Unconfiguring the client system removes the system tags that connect to the proxy server.
After you unconfigure the client system to disable the connection to the proxy server, insights-client must perform an upload to Insights before its system tags are updated in inventory.
2.4.2. Using tags to view Insights clients connected through a proxy server Copier lienLien copié sur presse-papiers!
Once you have configured an Insights client system to use a proxy server, you can identify the system by its tag in the Hybrid Cloud Console. The insights-proxy tag also indicates the Insights proxy to which the system is connected.
Prerequisites
- You have user permissions for the client systems in inventory.
- The client systems are configured to communicate with Insights through the proxy server. For more information about the configuration script, see Configuring client systems.
Procedure
- On the Hybrid Cloud Console, navigate to Inventory > Systems. The list of systems displays.
- Select the client system you want to view. The client system name displays in a pop-up.
-
Click the tag icon to the right of the system name. The tag icon links to a list of all system tags associated with the selected client system. This list includes the
insights-proxytag, along with the Insights proxy server hostname that the system uses.
2.4.3. Viewing systems connected to the Insights proxy servers using the Insights API Copier lienLien copié sur presse-papiers!
You can use the inventory API to identify Insights proxy servers in your environment. You can also use API calls to identify Insights client systems that use a specified proxy server to communicate.
For step-by-step instructions about how to authenticate and query the inventory API, download the Red Hat Insights API Cheat Sheet.
You must have login access to developers.redhat.com to access the API cheat sheet.
For information about how to make API calls, see Making API calls.
Prerequisites
- You have authenticated to the inventory API.
Procedure
- To obtain a list of deployed Insights proxy servers in your environment, use the following API call:
GET /api/inventory/v1/tags?search=insights-client/insights-proxy
GET /api/inventory/v1/tags?search=insights-client/insights-proxy
-
To view the list of Insights client systems configured to use a specific proxy server, use the following API call. Substitute the name of the proxy server for
<rhproxy-hostname>.
GET /api/inventory/v1/hosts?tags=insights-client/insights-proxy=<rhproxy-hostname>
GET /api/inventory/v1/hosts?tags=insights-client/insights-proxy=<rhproxy-hostname>
2.5. Connecting image-based systems to inventory Copier lienLien copié sur presse-papiers!
Red Hat Insights unifies all system types into a single, streamlined view. You can view and manage RPM (package mode), image mode, and OSTree-based systems from the same page in inventory. Red Hat Insights also includes filters that you can use to select and display image-based systems.
You can connect an image-based system to Red Hat Insights in the following ways:
- Connect automatically during image building
- Use rhc (Remote host configuration) to connect manually
- Use Red Hat Satellite to register the system
Additional resources
2.5.1. Connecting an image-based RHEL system to Insights during image building Copier lienLien copié sur presse-papiers!
You can automatically connect an image-based RHEL system to Insights during the image building process. This method involves pre-configuring the image so that when the image-based system is deployed and boots for the first time, it automatically registers with Remote Host Configuration (rhc).
To connect an image-based system to Insights, add an activation key to your build configuration. See https://gitlab.com/fedora/bootc/examples/-/tree/main/insights for sample code and examples.
2.5.2. Manually connecting an image-based RHEL system to Insights with rhc Copier lienLien copié sur presse-papiers!
If your image-based system is directly connected to Red Hat services or connects through a proxy server, use rhc to connect the system to Insights.
Prerequisites
- You have Organization Administrator permissions.
- You have an Organization ID.
- You have a terminal window open and you are logged in at the command line.
- You have created an activation key for rhc. For more information about activation keys, see Creating and managing activation keys in the Red Hat Hybrid Cloud Console.
Procedure
Use the following rhc command to configure the connection and register your system to Insights. Substitute the activation key for <AK> and your Organization ID for <org_id>.
rhc connect -s <AK> -o <org_id>
# rhc connect -s <AK> -o <org_id>Copy to Clipboard Copied! Toggle word wrap Toggle overflow
2.5.3. Using Red Hat Satellite to register image-based systems Copier lienLien copié sur presse-papiers!
Use your preferred registration method to register your image-based system with Red Hat Satellite. For more information about registration methods, see Registration methods.
For more information about how to register systems, see Registering hosts and setting up host integration.
For more information about how to use global registration, see Registering hosts by using global registration.
Make sure that Insights registration is enabled in Satellite before you generate the registration command. Select
Additional resources
2.5.4. Viewing image-based systems in inventory Copier lienLien copié sur presse-papiers!
Use the Image-based system filter to view image-based systems in inventory. To show details for a system, click on the system name. The System Details page includes the image URL and its corresponding hash value.
The bootc panel on the System Details page shows information about the following:
- Booted image
- Booted image digest
- Staged image
- Staged image digest
- Available image
- Available image digest
- Rollback image
- Rollback image digest
For more information about viewing and managing image-based systems, see Managing image mode in Red Hat Insights.
Prerequisites
- You are logged in to the Red Hat Hybrid Cloud Console.
- You have inventory-host-read and inventory-groups-read User Access permissions to view system inventory. For more information about how to configure User Access permissions, see User Access Configuration Guide for Role-based Access Control (RBAC).
Procedure
-
Navigate to
. - Select Filter by System type from the Filter drop-down, and then select Image-based system. This displays all of the image-based systems in inventory.
- Click on the name of the system you want to view. The System Details page for that system displays.
2.5.5. Adding an image-based system to a workspace Copier lienLien copié sur presse-papiers!
Prerequisites
- You have created a workspace in inventory.
Procedure
-
Navigate to
and select a workspace. - Click Add systems. The Add systems dialog box displays.
- Use the filters to locate the system you want to add.
- Select the checkbox next to the name of the system you want to add.
- Click Add systems. The console responds with a success message.
- Click Refresh to view the system in the workspace.
2.6. Deleting systems from inventory Copier lienLien copié sur presse-papiers!
When a system is obsolete or decommissioned, you might choose to remove it from inventory. Use the following procedure to do so:
Prerequisites
- You have Inventory Hosts administrator access.
Procedure
- Navigate to Red Hat Insights > RHEL > Inventory > Systems page.
- Check the box to the left of the system(s) you want to remove.
- Click the Delete button to the right of the filter. A Delete from Inventory confirmation dialog box appears.
- Click Delete to confirm this action.
A message box appears in the upper right corner of the screen, stating that the delete operation initiated. When the deletion is complete, a message box confirms that deletion was successful.
The selected system(s) will be removed from ALL console.redhat.com applications and services.
A system might reappear in inventory if data collectors are uploading data from systems that are still registered and subscribed. Refer to the documentation for the specific data collector(s) to determine how to permanently unregister or unsubscribe.
Additional resources