1spacecmd(1) spacecmd(1)
2
3
4
6 spacecmd - a command-line interface to Spacewalk and Satellite servers
7
9 spacecmd [options] [command]
10
12 spacecmd is a command-line interface to Spacewalk and Satellite servers.
13 It is written in Python and uses the XML-RPC API provided by the server.
14 Nearly all aspects of the Satellite can be managed by spacecmd. These
15 include managing systems, software channels, configuration channels,
16 activation keys, Kickstarts and users.
17
18 spacecmd can be run as an interactive shell by running it without a
19 command. It can also run a single command by passing the command
20 and the required arguments on the command line.
21
22 Run 'spacecmd help' to list the actions that are availble.
23
24 Run 'spacecmd help <command>' to get help for a particular command.
25
27 -u USERNAME, --username=USERNAME
28 use this username to connect to the server
29
30 -p PASSWORD, --password=PASSWORD
31 use this password to connect to the server
32
33 s SERVER, --server=SERVER
34 connect to this server [default: localhost]
35
36 --nossl
37 use HTTP instead of HTTPS
38
39 --nohistory
40 do not store command history
41
42 -y, --yes
43 answer yes for all questions
44
45 -q, --quiet
46 print only error messages
47
48 -d, --debug
49 print debug messages
50
51 -h, --help
52 show this help message and exit
53
55 Make temporary groups on-the-fly
56 spacecmd> ssm_add search:driver:bnx2
57 Systems Selected: 111
58
59 spacecmd> ssm_add search:device:vmware
60 Systems Selected: 285
61
62 spacecmd> ssm_add search:hostname:external.example.com
63 Systems Selected: 16
64
65
66 Add and remove packages from the commandline
67 [user@sat]$ spacecmd -y system_installpackage www* mod_python
68 Scheduled 6 system(s)
69
70 [user@sat]$ spacecmd -y system_removepackage wiki02 mod_perl
71 Scheduled 1 system(s)
72
73
74 Apply errata from the command line
75 [user@sat]$ spacecmd -y errata_apply RHSA-2010:0423
76 Scheduled 42 system(s)
77
78 [user@sat]$ spacecmd -y system_applyerrata group:web_servers RHSA-2010:0040
79 Scheduled 16 system(s)
80
81
82 Access information on the command line without writing custom API
83 scripts
84 [root@sat]# spacecmd get_entitlements | grep -e monitoring -e provisioning
85 monitoring_entitled: 314/397
86 provisioning_entitled: 322/397
87
88
89 Quickly generate reports
90 spacecmd> system_listerrata ldap03
91 System: ldap03
92
93 Security Errata:
94 RHSA-2010:0458 Moderate: perl security update 6/7/10
95 RHSA-2010:0449 Moderate: rhn-client-tools security update 6/1/10
96 RHSA-2010:0423 Important: krb5 security update 5/18/10
97
98 spacecmd> report_errata
99 # Systems Errata
100 --------- ------
101 CLA-2010:0474 88
102 CLA-2010:0475 6
103 CLA-2010:0488 183
104 CLA-2010:0490 273
105 CLA-2010:0500 4
106 CLA-2010:0501 5
107 RHBA-2010:0402 1
108 RHSA-2010:0474 2
109 RHSA-2010:0488 1
110 RHSA-2010:0490 5
111
112 spacecmd> report_outofdatesystems
113 System Packages
114 ------ --------
115 monkey 310
116 shark 63
117 hedgehog 39
118 pomeranian 4
119
120 spacecmd> report_ipaddresses
121 System Hostname IP
122 ------ -------- --
123 dns01 dns01.dmz.example.com 192.168.254.53
124 www01 www01.dmz.example.com 192.168.254.80
125 ztest ztest.test.example.com 192.168.42.111
126
127 spacecmd> report_kernels
128 System Kernel
129 ------ ------
130 system01 2.6.9-89.0.25.ELsmp
131 system02 2.6.9-89.0.3.ELsmp
132 system03 2.6.9-89.0.26.ELsmp
133
134
135 Tab completion of everything
136 spacecmd> system_installpackage ssm vmware-tools [tab]
137 vmware-tools vmware-tools-kmod
138 vmware-tools-common vmware-tools-nox
139
140
141 Easily view system information
142 spacecmd> system_details www01.example.com
143 Name: www01.example.com
144 System ID: 1000010001
145 Locked: False
146 Registered: 20100311 19:31:36
147 Last Checkin: 20100621 18:31:53
148 OSA Status: online
149
150 Hostname: www01.example.com
151 IP Address: 192.168.1.80
152 Kernel: 2.6.18-164.el5
153
154 Software Channels:
155 custom-rhel-i386-server-5
156 |-- custom-extras-i386-rhel5
157 |-- clone-rhn-tools-rhel-i386-server-5
158
159 Configuration Channels:
160 sudoers
161 base
162 base-rhel5
163
164 Entitlements:
165 Management
166 Monitoring
167 Provisioning
168
169 System Groups:
170 all_linux_systems
171 all_linux_VMs
172 rhel5-i386
173
175 Please report any bugs directly to the author or to the 'Issues' section
176 at http://github.com/aparsons/spacecmd
177
179 spacecmd was written by Aron Parsons <aron@redhat.com>
180
181
182
183Aron Parsons spacecmd(1)