Python for Unix and Linux System Administration

Efficient Problem-Solving with Python

Noah Gift, Jeremy M. Jones

Publisher: O'Reilly, 2008, 434 pages

ISBN: 978-0-596-51582-9

Keywords: Python, System Administration

Last modified: Dec. 1, 2008, 11:10 a.m.

Python for Unix and Linux System Administration demonstrates how the Python language offers you a more efficient way to handle various tasks when managing Unix and Linux servers. Each chapter presents a particular administrative issue, such as concurrency or data backup, and offers Python solutions through hands-on examples. You’ll learn to develop your own set of command line utilities with Python to tackle a wide range of problems.

The authors also built a free, downloadable Ubuntu virtual machine that includes the book’s source code and runs examples with SNMP, IPython, SQLAlchemy, and many other utilities.

With this book, you will discover how Python can help you:

  • Read text files and extract information
  • Run tasks concurrently using the threading and forking options
  • Get information from one process to another using network facilities
  • Create clickable GUIs to handle large and complex utilities
  • Monitor large clusters of machines by interacting with SNMP programmatically
  • Master the IPython Interactive Python shell to replace or augment Bash, Korn, or Z-Shell
  • Integrate Cloud Computing into your infrastructure, and learn to write a Google App Engine Application
  • Solve unique data backup challenges with customized scripts
  • Use the Django SQLAlchemy, and Storm ORMs to interact with databases

With this book, you'll learn how to package and deploy your Python applications and libraries, and write code that runs equally well on multiple Unix an Linux platforms.

  • Chapter 1: Introduction
    • Why Python?
    • Motivation
    • The Basics
    • Executing Statements in Python
    • Using Functions in Python
    • Reusing Code with the Import Statement
  • Chapter 2: IPython
    • Installing IPython
    • Basic Concepts
    • Help with Magic Functions
    • Unix Shell
    • Information Gathering
    • Automation and Shortcuts
    • Summary
  • Chapter 3: Text
    • Python Built-ins and Modules
    • Log Parsing
    • ElementTree
    • Summary
  • Chapter 4: Documentation and Reporting
    • Automated Information Gathering
    • Manual Information Gathering
    • Information Distribution
    • Summary
  • Chapter 5: Networking
    • Network Clients
    • Remote Procedure Call Facilities
    • SSH
    • Twisted
    • Scapy
    • Creating Scripts with Scapy
  • Chapter 6: Data
    • Introduction
    • Using the OS Module to Interact with Data
    • Copying, Moving, Renaming, and Deleting Data
    • Working with Paths, Directories, and Files
    • Comparing Data
    • Merging Data
    • Pattern Matching Files and Directories
    • Wrapping Up rsync
    • Metadata: Data About Data
    • Archiving, Compressing, Imaging, and Restoring
    • Using tarfile Module to Create TAR Archives
    • Using a tarfile Module to Examine the Contents of TAR Files
  • Chapter 7: SNMP
    • Introduction
    • Brief Introduction to SNMP
    • IPython and Net-SNMP
    • Discovering a Data Center
    • Retrieving Multiple-Values with Net-SNMP
    • Creating Hybrid SNMP Tools
    • Extending Net-SNMP
    • SNMP Device Control
    • Enterprise SNMP Integration with Zenoss
  • Chapter 8: OS Soup
    • Introduction
    • Cross-Platform Unix Programming in Python
    • PyInotify
    • OS X
    • Red Hat Linux Systems Administration
    • Ubuntu Administration
    • Solaris Systems Administration
    • Virtualization
    • Cloud Computing
    • Using Zenoss to Manage Windows Servers from Linux
  • Chapter 9: Package Management
    • Introduction
    • Setuptools and Python Eggs
    • Using easy_install
    • easy_install Advanced Features
    • Creating Eggs
    • Entry Points and Console Scripts
    • Registering a Package with the Python Package Index
    • Distutils
    • Buildout
    • Using Buildout
    • Developing with Buildout
    • virtualenv
    • EPM Package Manager
  • Chapter 10: Processes and Concurrency
    • Introduction
    • Subprocess
    • Using Supervisor to Manage Processes
    • Using Screen to Manage Processes
    • Threads in Python
    • Processes
    • Processing Module
    • Scheduling Python Processes
    • daemonizer
    • Summary
  • Chapter 11: Building GUIs
    • GUI Building Theory
    • Building a Simple PyGTK App
    • Building an Apache Log Viewer Using PyGTK
    • Building an Apache Log Viewer Using Curses
    • Web Applications
    • Django
    • Conclusion
  • Chapter 12: Data Persistence
    • Simple Serialization
    • Relational Serialization
    • Summary
  • Chapter 13: Command Line
    • Introduction
    • Basic Standard Input Usage
    • Introduction to Optparse
    • Simple Optparse Usage Patterns
    • Unix Mashups: Integrating Shell Commands into Python Command-Line Tools
    • Integrating Configuration Files
    • Summary
  • Chapter 14: Pragmatic Examples
    • Managing DNS with Python
    • Using LDAP with OpenLDAP, Active Directory, and More with Python
    • Apache Log Reporting
    • FTP Mirror
  • Appendix : Callbacks

Reviews

Python for Unix and Linux System Administration

Reviewed by Roland Buresund

OK ***** (5 out of 10)

Last modified: Dec. 1, 2008, 11:10 a.m.

What started out as a much anticipated book, was soon destroyed by the extremely bad editing. I don't mind a few syntax errors, but on every page!? Furthermore, I dislike when a topic suddenly starts refering to another topic and it is explained 150 pages later!

I could go on, but the quality of O'Reilly books have never been lower than this.

It could have been an outstanding book, but all the mistakes, combined with the sometimes shallow coverage, makes it only Ok.

Comments

There are currently no comments

New Comment

required

required (not published)

optional

required

captcha

required