spacecmd

Langue: en

Version: 372253 (fedora - 01/12/10)

Section: 1 (Commandes utilisateur)

NAME

spacecmd - a command-line interface to Spacewalk and Satellite servers

SYNOPSIS

spacecmd [options] [command]

OVERVIEW

 spacecmd is a command-line interface to Spacewalk and Satellite servers.
 It is written in Python and uses the XML-RPC API provided by the server.
 Nearly all aspects of the Satellite can be managed by spacecmd.  These
 include managing systems, software channels, configuration channels,
 activation keys, Kickstarts and users.
 
 spacecmd can be run as an interactive shell by running it without a
 command.  It can also run a single command by passing the command
 and the required arguments on the command line.
 
 Run 'spacecmd help' to list the actions that are availble.
 
 Run 'spacecmd help <command>' to get help for a particular command.
 

OPTIONS

-u USERNAME, --username=USERNAME
use this username to connect to the server
-p PASSWORD, --password=PASSWORD
use this password to connect to the server
s SERVER, --server=SERVER
connect to this server [default: localhost]
--nossl
use HTTP instead of HTTPS
--nohistory
do not store command history
-y, --yes
answer yes for all questions
-q, --quiet
print only error messages
-d, --debug
print debug messages
-h, --help
show this help message and exit

EXAMPLES

Make temporary groups on-the-fly
 spacecmd> ssm_add search:driver:bnx2
 Systems Selected: 111
 
 spacecmd> ssm_add search:device:vmware
 Systems Selected: 285
 
 spacecmd> ssm_add search:hostname:external.example.com
 Systems Selected: 16
 

Add and remove packages from the commandline

 [user@sat]$ spacecmd -y system_installpackage www* mod_python
 Scheduled 6 system(s)
 
 [user@sat]$ spacecmd -y system_removepackage wiki02 mod_perl
 Scheduled 1 system(s)
 

Apply errata from the command line

 [user@sat]$ spacecmd -y errata_apply RHSA-2010:0423
 Scheduled 42 system(s)
 
 [user@sat]$ spacecmd -y system_applyerrata group:web_servers RHSA-2010:0040
 Scheduled 16 system(s)
 

Access information on the command line without writing custom API scripts

 [root@sat]# spacecmd get_entitlements | grep -e monitoring -e provisioning
 monitoring_entitled: 314/397
 provisioning_entitled: 322/397
 

Quickly generate reports

 spacecmd> system_listerrata ldap03
 System: ldap03
 
 Security Errata:
 RHSA-2010:0458  Moderate: perl security update                        6/7/10
 RHSA-2010:0449  Moderate: rhn-client-tools security update            6/1/10
 RHSA-2010:0423  Important: krb5 security update                      5/18/10
 
 spacecmd> report_errata
 # Systems       Errata
 ---------       ------
 CLA-2010:0474       88
 CLA-2010:0475        6
 CLA-2010:0488      183
 CLA-2010:0490      273
 CLA-2010:0500        4
 CLA-2010:0501        5
 RHBA-2010:0402       1
 RHSA-2010:0474       2
 RHSA-2010:0488       1
 RHSA-2010:0490       5
 
 spacecmd> report_outofdatesystems
 System        Packages
 ------        --------
 monkey             310
 shark               63
 hedgehog            39
 pomeranian           4
 
 spacecmd> report_ipaddresses
 System   Hostname                IP
 ------   --------                --
 dns01    dns01.dmz.example.com   192.168.254.53
 www01    www01.dmz.example.com   192.168.254.80
 ztest    ztest.test.example.com  192.168.42.111
 
 spacecmd> report_kernels
 System       Kernel
 ------       ------
 system01     2.6.9-89.0.25.ELsmp
 system02     2.6.9-89.0.3.ELsmp
 system03     2.6.9-89.0.26.ELsmp
 

Tab completion of everything

 spacecmd> system_installpackage ssm vmware-tools [tab]
 vmware-tools         vmware-tools-kmod
 vmware-tools-common  vmware-tools-nox
 

Easily view system information

 spacecmd> system_details www01.example.com
 Name:          www01.example.com
 System ID:     1000010001
 Locked:        False
 Registered:    20100311 19:31:36
 Last Checkin:  20100621 18:31:53
 OSA Status:    online
 
 Hostname:      www01.example.com
 IP Address:    192.168.1.80
 Kernel:        2.6.18-164.el5
 
 Software Channels:
   custom-rhel-i386-server-5
     |-- custom-extras-i386-rhel5
     |-- clone-rhn-tools-rhel-i386-server-5
 
 Configuration Channels:
   sudoers
   base
   base-rhel5
 
 Entitlements:
   Management
   Monitoring
   Provisioning
 
 System Groups:
   all_linux_systems
   all_linux_VMs
   rhel5-i386
 
 

BUGS

 Please report any bugs directly to the author or to the 'Issues' section
 at http://github.com/aparsons/spacecmd
 

AUTHOR

spacecmd was written by Aron Parsons <aron@redhat.com>