Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
linux_wiki:spacecmd_spacewalk_cmd_line [2015/03/25 01:01] billdozor |
linux_wiki:spacecmd_spacewalk_cmd_line [2019/05/25 23:50] (current) |
||
---|---|---|---|
Line 3: | Line 3: | ||
**General Information** | **General Information** | ||
- | Spacewalk provides centralized management of Red Hat systems. | + | Spacewalk provides centralized management of Red Hat systems. |
+ | * Official Site: https:// | ||
+ | * Local Wiki Page: [[linux_wiki: | ||
+ | |||
+ | Spacecmd is the command line interface to the server and is much faster than logging into the web portal. | ||
**Checklist** | **Checklist** | ||
- | * Spacewalk server setup | + | * Distro(s): Enterprise Linux |
- | * Spacewalk user account created | + | * Other: [[https:// |
+ | * Other: | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Install Spacecmd ===== | ||
+ | |||
+ | * Add spacewalk client repo | ||
+ | * CentOS 6<code bash>rpm -Uvh http:// | ||
+ | * CentOS 7<code bash>rpm -Uvh http:// | ||
+ | * Install spacecmd | ||
+ | * <code bash>yum install spacecmd</ | ||
---- | ---- | ||
Line 17: | Line 32: | ||
Create the file ~/ | Create the file ~/ | ||
<code bash> | <code bash> | ||
- | code will go here | + | mkdir ~/ |
+ | chmod 700 ~/ | ||
+ | touch ~/ | ||
+ | chmod 600 ~/ | ||
</ | </ | ||
- | ==== Useful Alias ==== | + | Edit the file |
+ | <code bash> | ||
+ | vim ~/ | ||
+ | |||
+ | [spacecmd] | ||
+ | server=spacewalkserver.mydomain.com | ||
+ | username=usernamehere | ||
+ | password=passwordhere | ||
+ | </ | ||
+ | |||
+ | Verify configuration by testing connectivity | ||
+ | <code bash> | ||
+ | spacecmd | ||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Useful Alias ===== | ||
It is also useful to create the following alias in your ~/.bashrc file | It is also useful to create the following alias in your ~/.bashrc file | ||
Line 31: | Line 66: | ||
---- | ---- | ||
- | ===== Spacecmd Example Commands | + | ===== Clear Caches |
- | Example content will go here. | + | Spacecmd creates a local cache of system queries to improve performance. This can leave you with outdated information when working at the CLI in some situations. |
- | ==== Sub-section Title ==== | + | To clear the local cache |
+ | <code bash> | ||
+ | spacecmd clear_caches | ||
+ | </ | ||
- | Section 2, sub-content. | + | ---- |
+ | |||
+ | ===== Group Commands ===== | ||
+ | |||
+ | List system groups | ||
+ | <code bash> | ||
+ | spacecmd group_list | ||
+ | </ | ||
+ | |||
+ | List systems in a group | ||
+ | <code bash> | ||
+ | spacecmd group_listsystems < | ||
+ | </ | ||
+ | |||
+ | Add systems to a group (SYSTEMS space separated) | ||
+ | <code bash> | ||
+ | spacecmd group_addsystems < | ||
+ | </ | ||
+ | |||
+ | Remove systems from a group (SYSTEMS space separated) | ||
+ | <code bash> | ||
+ | spacecmd group_removesystems < | ||
+ | </ | ||
+ | |||
+ | ===== System Commands ===== | ||
+ | |||
+ | List all systems (good for piping to grep) | ||
+ | <code bash> | ||
+ | spacecmd system_list | ||
+ | </ | ||
+ | |||
+ | Delete system(s) from Spacewalk (SYSTEMS space separated) | ||
+ | <code bash> | ||
+ | spacecmd system_delete < | ||
+ | </ | ||
+ | |||
+ | List a System' | ||
+ | <code bash> | ||
+ | spacecmd system_listbasechannel < | ||
+ | </ | ||
+ | |||
+ | List a System' | ||
+ | <code bash> | ||
+ | spacecmd system_listchildchannels < | ||
+ | </ | ||
+ | |||
+ | Set an entire group' | ||
+ | <code bash> | ||
+ | spacecmd -y system_setbasechannel group:< | ||
+ | </ | ||
+ | |||
+ | List systems in a group and all errata except kernel: | ||
+ | <code bash> | ||
+ | spacecmd system_listerrata group:< | ||
+ | </ | ||
+ | |||
+ | Errata install command: | ||
+ | <code bash> | ||
+ | spacecmd -y system_applyerrata group:< | ||
+ | </ | ||
+ | |||
+ | List installed packages, grep for glibc: | ||
+ | <code bash> | ||
+ | spacecmd system_listinstalledpackages < | ||
+ | </ | ||
---- | ---- | ||
+ | ===== Report Commands ===== | ||
+ | |||
+ | Systems Not in Any Group | ||
+ | <code bash> | ||
+ | spacecmd report_ungroupedsystems | ||
+ | </ | ||
+ | |||
+ | Systems Not Checking In and Last Checkin Time | ||
+ | <code bash> | ||
+ | spacecmd report_inactivesystems | ||
+ | </ | ||
+ | |||
+ | ---- |