linux_wiki:spacecmd_spacewalk_cmd_line

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
linux_wiki:spacecmd_spacewalk_cmd_line [2015/03/25 01:00]
billdozor created
linux_wiki:spacecmd_spacewalk_cmd_line [2019/05/25 23:50] (current)
Line 1: Line 1:
-====== Spacecmd Spacewalk Cmd Line ======+====== Spacecmd ======
  
 **General Information** **General Information**
  
-Spacewalk provides centralized management of Red Hat systems. (https://fedorahosted.org/spacewalk/) Spacecmd is the command line interface to the server and is much faster than logging into the web portal.+Spacewalk provides centralized management of Red Hat systems. 
 +  * Official Site: https://fedorahosted.org/spacewalk/) 
 +  * Local Wiki Page: [[linux_wiki:spacewalk]] 
 + 
 +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://fedorahosted.org/spacewalk/wiki/HowToInstall|Spacewalk server]] setup 
 +  * Other: Spacewalk user account created 
 + 
 +---- 
 + 
 +===== Install Spacecmd ===== 
 + 
 +  * Add spacewalk client repo 
 +    * CentOS 6<code bash>rpm -Uvh http://yum.spacewalkproject.org/2.4-client/RHEL/6/x86_64/spacewalk-client-repo-2.4-3.el6.noarch.rpm</code> 
 +    * CentOS 7<code bash>rpm -Uvh http://yum.spacewalkproject.org/2.4-client/RHEL/7/x86_64/spacewalk-client-repo-2.4-3.el7.noarch.rpm</code> 
 +  * Install spacecmd 
 +    * <code bash>yum install spacecmd</code>
  
 ---- ----
Line 17: Line 32:
 Create the file ~/.spacecmd/config Create the file ~/.spacecmd/config
 <code bash> <code bash>
-code will go here+mkdir ~/.spacecmd 
 +chmod 700 ~/.spacecmd 
 +touch ~/.spacecmd/config 
 +chmod 600 ~/.spacecmd/config
 </code> </code>
  
-==== Useful Alias ====+Edit the file 
 +<code bash> 
 +vim ~/.spacecmd/config 
 + 
 +[spacecmd] 
 +server=spacewalkserver.mydomain.com 
 +username=usernamehere 
 +password=passwordhere 
 +</code> 
 + 
 +Verify configuration by testing connectivity 
 +<code bash> 
 +spacecmd 
 +</code> 
 + 
 +---- 
 + 
 +===== 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 
 +</code>
  
-Section 2, sub-content.+---- 
 + 
 +===== Group Commands ===== 
 + 
 +List system groups 
 +<code bash> 
 +spacecmd group_list 
 +</code> 
 + 
 +List systems in a group 
 +<code bash> 
 +spacecmd group_listsystems <GROUP> 
 +</code> 
 + 
 +Add systems to a group (SYSTEMS space separated) 
 +<code bash> 
 +spacecmd group_addsystems <GROUP> <SYSTEMS> 
 +</code> 
 + 
 +Remove systems from a group (SYSTEMS space separated) 
 +<code bash> 
 +spacecmd group_removesystems <GROUP> <SYSTEMS> 
 +</code> 
 + 
 +===== System Commands ===== 
 + 
 +List all systems (good for piping to grep) 
 +<code bash> 
 +spacecmd system_list 
 +</code> 
 + 
 +Delete system(s) from Spacewalk (SYSTEMS space separated) 
 +<code bash> 
 +spacecmd system_delete <SYSTEMS> 
 +</code> 
 + 
 +List a System's Base Channel 
 +<code bash> 
 +spacecmd system_listbasechannel <SYSTEM> 
 +</code> 
 + 
 +List a System's Child Channels 
 +<code bash> 
 +spacecmd system_listchildchannels <SYSTEM> 
 +</code> 
 + 
 +Set an entire group's base channel 
 +<code bash> 
 +spacecmd -y system_setbasechannel group:<GROUP-NAME> <BASE-CHANNEL-NAME> 
 +</code> 
 + 
 +List systems in a group and all errata except kernel: 
 +<code bash> 
 +spacecmd system_listerrata group:<GROUP-NAME> | grep -vi "kernel" 
 +</code> 
 + 
 +Errata install command: 
 +<code bash> 
 +spacecmd -y system_applyerrata group:<GROUP-NAME> <ERRATA-NAME> 
 +</code> 
 + 
 +List installed packages, grep for glibc: 
 +<code bash> 
 +spacecmd system_listinstalledpackages <SYSTEM>  | grep glibc 
 +</code>
  
 ---- ----
  
 +===== Report Commands =====
 +
 +Systems Not in Any Group
 +<code bash>
 +spacecmd report_ungroupedsystems
 +</code>
 +
 +Systems Not Checking In and Last Checkin Time
 +<code bash>
 +spacecmd report_inactivesystems
 +</code>
 +
 +----
  • linux_wiki/spacecmd_spacewalk_cmd_line.1427259642.txt.gz
  • Last modified: 2019/05/25 23:50
  • (external edit)