Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

Where have all my subscriptions gone?

July 15, 2016
John Herr
Related topics:
Open source
Related products:
Red Hat Enterprise Linux

    Red Hat's Content Delivery Network (CDN) is a great tool to help ensure systems have the latest supported packages available to install. Simply register your system, attach it to a subscription pool id, and start installing packages. This is great, this is easy.

    There is a nice interface on the Red Hat Customer Portal ( http://access.redhat.com ) that allows you to manage your CDN account. It allows you to see when your subscriptions are expiring, information about the individual systems that are registered, among other things. However, what I would like to do is easily look at a subscription and see which systems are using it or when they last checked in. If they have not checked in for a while, we can probably reuse their entitlement.

    If you are like me, it can be a challenge to keep track of the systems that have registered and are using subscriptions. I have 20+ people registering systems to this account, we can easily spin up dozens of systems a day during testing. We redeploy these systems multiple times during a day, a lot of times these systems have random names. If they do not get unregistered before they are reinstalled then they consume subscriptions within CDN. Eventually we run out of the needed subscriptions.

    Currently, you can login to the Customer Portal and check what subscriptions a system is using simply by selecting system. One drawback, however, is that you cannot select a subscription and see which systems are registered to it or when they last checked in.

    Luckily, the Red Hat CDN has an API that can be taken advantaged of to solve some of these problems. The Red Hat CDN is based off the Candlepin project, see Overview of Red Hat Subscription Management. We can use the Candlepin API reference to see what we can do.

    I played around with the API and found out it gave me some great information. I could tell when systems registered and to which subscriptions and pools. I could tell when they last checked in as well. Everything I wanted to know was now easily available to me.

    Everything I want to know is available though the /owner path. More specifically, the /owner/{owner_key}/pools, /owner/{owner_key}/consumers, and /owner/{owner_key}/entitlements paths. The OWNER_KEY is the same as the "org ID" that is returned when issuing the "subscription-manager identity" command.

    Using the hostname and prefix settings from the /etc/rhsm/rhsm.conf I can now build the URLs I needed to query.

    • https://subscription.rhn.redhat.com/subscription/owners/OWNER_ID/pools
      • The usage of the pools.
    • https://subscription.rhn.redhat.com/subscription/owners/OWNER_ID/consumers
      • Information on the check-in dates of the systems.
    • https://subscription.rhn.redhat.com/subscription/owners/OWNER_ID/entitlements
      • Information about the systems and which entitlements they are consuming.

    The output returned is in the JSON format and is difficult to read. Running it through a parser like jq makes the output much easier to read.

    Here are the commands I used to view the information I needed:

    • curl -X GET -u CDN_USERNAME:CDN_PASSWORD -k 'https://subscription.rhn.redhat.com/subscription/owners/OWNER_ID/pools'
    • curl -X GET -u CDN_USERNAME:CDN_PASSWORD -k 'https://subscription.rhn.redhat.com/subscription/owners/OWNER_ID/consumers'
    • curl -X GET -u CDN_USERNAME:CDN_PASSWORD -k 'https://subscription.rhn.redhat.com/subscription/owners/OWNER_ID/entitlements'

    Now that I have the data, I need to go through the information to see how my subscriptions are being used. I really hate this part. But luckily I am a firm believer in scripting such tasks. After all, I am sure I will need to do this many times in the future.

    Scripting away!

    Last updated: September 5, 2023

    Recent Posts

    • Red Hat Enterprise Linux 10.2 and 9.8: Top features for developers

    • What GPU kernels mean for your distributed inference

    • Debugging image mode with Red Hat OpenShift 4.20: A practical guide

    • EvalHub: Because "looks good to me" isn't a benchmark

    • SQL Server HA on RHEL: Meet Pacemaker HA Agent v2 (tech preview)

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Chat Support

    Please log in with your Red Hat account to access chat support.