Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to generate a list of all the packages installed per server without having to go through each using rpm. I'm thinking Satellite should be able to provide this in a decent (hopefully easily parsed) format.

share|improve this question

Short answer: yes.

Longer answer: you'll need to look in to to the Satellite API. The documentation available with Satellite is good for a very basic query, but you'll quickly get in to queries that (IMHO) aren't as well documented. At a high level, what you'll end up doing is querying Satellite for a list of all registered systems, then using that list to issue queries for all installed packages on each system. Ultimately, this will only be valid as of the last time each system updated its package profile on the Satellite, but it'll be more central than trolling each individual system via an RPM query.

Here's the code I use (sanitized, of course) to list the systems registered to my Satellite:

import xmlrpclib

SAT_URL = "https://<satellite hostname>/rpc/api"
SAT_USER = "<satellite user name>"
SAT_PASS = "<password for above login id>"

client = xmlrpclib.Server(SAT_URL, verbose=0)
key = client.auth.login(SAT_USER, SAT_PASS)

syslist = client.system.listSystems(key)

The syslist variable is them a simple Python list of system objects - I've not yet had need to unzip it any further than:

for sys in syslist:
  print "%s registered with Satellite" % (sys['name'],)
share|improve this answer
Ok this is working. Looks like I'll need to dig into it some more but this is a really good start. Thanks. I'll see where I get and update. – Mark Jul 2 '13 at 12:52
I extended your script and posted the script as a solution. I'm not sure if that's the proper etiquette. – Mark Jul 2 '13 at 13:56

Here's a final script which extends John's answer to provide a full solution.

import xmlrpclib

SAT_URL = "https://<SATELLITE_IP>/rpc/api"

client = xmlrpclib.Server(SAT_URL, verbose=0)
key = client.auth.login(SAT_USER, SAT_PASS)

syslist = client.system.listSystems(key)
systems = {}
for system in syslist:
    systems[system['name']] = client.system.listPackages(key, system['id'])

# Print out list in a Markdown-like format.
for system in sorted(systems.keys()):
    print '%s' % system
    print '=' * len(system)
    for package in systems[system]:
        print '- %s %s' % (package['name'], package['version'])
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.