Host list with Hammer CLI
On occasion I need to pull a host list from Satellite 6; and while using the web ui is often simple enough, the hammer cli that comes with foreman is often faster.
Here is a quick way to get a full host list:
hammer host list
That command will print list of all hosts registered with your Satellite server.
Filter by OS major version
Often when Iβm generating this list itβs because someone has asked me something like: βHow many RHEL 5, servers do we have?β
You can generate a list of all the Red Hat Enterprise Linux 5 machines you have registered to Satellite like this:
hammer host list β-search os_major=5
Of course if you wanted to see RHEL 6 or 7 or 8 you would just replace the β5β, with the major version of the OS you were looking for.
Checkout other options with the help option
hammer host list β-help