This site is now 100% read-only, and retired.

Book Review: Perl for System Administration

Posted by Steve on Mon 21 Nov 2005 at 12:32

As an ex-programmer with a reasonably good knowledge of the Perl programming language I recently re-read this book with an aim to reviewing it. Read on for my thoughts on this classic book.

The Target Audience

The book claims to require the reader to possess "some" knowledge of the Perl language. I feel this was perhaps an overly ambitions goal, and that to gain fully from the book the reader should be reasonably familiar with common Perl idioms.

The earliest discussion does start of being simpler than the later chapters I think that despite the clear language a complete Perl-newcomer might be a little lost in places.

About The Book

Perl For System Administration is a relatively slim volume coming it at around 444 pages. Despite that it manages to contain a lot of content and numerous examples.

As you may hope from the name the book is fairly open and doesn't limit itself to discussion of any one particular operating system. Instead there are both portable examples, and focused discussion which only apply to a specific operating systems. (Whilst there is no mention of Mac OS X because the book was published in 2000 the examples included apply to GNU/Linux, Solaris, and Microsoft Windows.)

The full table of contents is as follows:

  1. Introduction
    • System Administration Is a Craft
    • How Perl Can Help
    • This Book Will Show You How
    • What You Need
    • Locating and Installing Modules
    • It's Not Easy Being Omnipotent
    • References for More Information
  2. Filesystems
    • Perl to the Rescue
    • Filesystem Differences
    • Walking or Traversing the Filesystem
    • Walking the Filesystem Using the File::Find Module
    • Manipulating Disk Quotas
    • Querying Filesystem Usage
    • Module Information for This Chapter
    • References for More Information
  3. User Accounts
    • Unix User Identity
    • Windows NT/2000 User Identity
    • Building an Account System to Manage Users
    • Module Information for This Chapter
    • References for More Information
  4. User Activity
    • MacOS Process Control
    • NT/2000 Process Control
    • Unix Process Control
    • Tracking File and Network Operations
    • Module Information for This Chapter
    • References for More Information
  5. TCP/IP Name Services
    • Host Files
    • NIS, NIS+, and WINS
    • Domain Name Service (DNS)
    • Module Information for This Chapter
    • References for More Information
  6. Directory Services
    • What's a Directory?
    • Finger: A Simple Directory Service
    • The WHOIS Directory Service
    • LDAP: A Sophisticated Directory Service
    • ADSI (Active Directory Service Interfaces)
    • Module Information for This Chapter
    • References for More Information
  7. SQL Database Administration
    • Interacting with an SQL Server from Perl
    • Using the DBI Framework
    • Using the ODBC Framework
    • Server Documentation
    • Database Logins
    • Monitoring Server Health
    • Module Information for This Chapter
    • References for More Information
  8. Electronic Mail
    • Sending Mail
    • Common Mistakes in Sending Email
    • Receiving Mail
    • Module Information for This Chapter
    • References for More Information
  9. Log Files - This chapter is available online
    • Text Logs
    • Binary Log Files
    • Stateful and Stateless Data
    • Disk Space Problems
    • Log Analysis
    • Module Information for This Chapter
    • References for More Information
  10. Security and Network Monitoring
    • Noticing Unexpected or Unauthorized Changes
    • Noticing Suspicious Activities
    • SNMP
    • Danger on the Wire
    • Preventing Suspicious Activities
    • Module Information for This Chapter
    • References for More Information
  11. Appendices
    • The Five-Minute RCS Tutorial
    • The Ten-Minute LDAP Tutorial
    • The Eight-Minute XML Tutorial
    • The Fifteen-Minute SQL Tutorial
    • The Twenty-Minute SNMP Tutorial
The Good

Throughout the book there are several unifying themes which are repeated several times. The most obvious theme is:

  • Databases are good.

This statement is repeated in several different guises at various points, and is something that I enjoyed reading.

The usage of the word "database" shouldn't be taken literally to mean something like MySQL, Postgres, or Oracle. Instead think of files such as /etc/passwd which are text databases - containing fixed records.

Within the standard Unix filesystem there are countless examples of such files, and it is worth thinking of them as databases when it comes to querying and manipulating them. Common examples include the previously mentioned passwd file, the matching groups file /etc/group, system mail aliases /etc/aliases, the system hosts file /etc/hosts & etc.

Although SQL is introduced (and is briefly discussed in one of the appendices) there is no thorough coverage.

One of the great Perl strengths is the large community which supports it. The Comprehensive Perl Archive Network is one of the key attractions for me personally; it contains pre-written modules for almost everything you might wish to use with Perl.

Although there is an introduction to installaing modules from CPAN I was suprised to see how basic this was; giving no hint of installing from a distribution-specific package repository for example. Debian has many of the more common Perl modules available within its archive; and Debian packages can also be easily built directly.

The Bad

A minor failing I feel I could mention is the lack of "strict" coding. Perl the interpreter has a series of warnings which you can enable to test for common coding errors. (Analogous to the usage of -Wall used to enable all of GCCs compile time warnings). These warnings are usually enabled by starting your script like this:

#!/usr/bin/perl 

use strict;
use warnings;

None of the examples used these facilities.

Whilst this lack of warnings, and extra strictness, might not be a problem for the code as described (or available for download) it is disappointing they are not present - both as a reminder to use them yourself, and to aid you in modifying the code for your own needs.

Summary

Even now as a fairly accomplished programmer and systems administrator I still find reading this book very useful.

It appeals to my nature of automation - I find it tedious to repeatedly perform the same tasks, and Perl is wonderfully suited to many common automation jobs.

Although scoring books is both difficult, and very subjective, I would find it hard to give this book a rating below 75%. If it were updated with a new edition in the future with a bit more fresh content it would certainly score closer to 85%.

Details
Title Perl for System Administration
Authors David N. Blank-Edelman
Publisher O'Reilly
ISBN 1-56592-609-9
Cover Price $34.95
Availability

 

 


Re: Book Review: Perl for System Administration
Posted by Anonymous (200.55.xx.xx) on Wed 23 Nov 2005 at 20:46
Muy buen libro, pero como vamos a adquirirlo los que no tenemos dinero para pagarlo, se supone que esto es opensource, y la documentaci�n tambi�n debe ser opensource, me parece que este art�culo no es adecuado para el sitio.

http://www.debian-administration.org (SO-Open Source)

[ Parent ]

Re: Book Review: Perl for System Administration
Posted by Steve (82.41.xx.xx) on Thu 24 Nov 2005 at 10:27
[ View Weblogs ]

Using babelfish I translated your comment as follows:

Very good book, but as we are going to acquire it those that we do not have money to pay it, assumes that this is opensource, and the documentation also must be opensource, seems to me that this article is not adapted for the site.

(Apologies if this is incorrect. Foreign languages are hard for me).

I think you're making a mistake to suggest that everything must be free. Especially documentation or supporting information.

Whilst I would (obviously) prefer free information, and attempt to produce and share it upon this site, I'm concious that software and documentation are two entirely different things - and that people take real time and effort to produce both.

I think the review fits here because it is a book designed for system administrators - regardless of how free or non-free the book is the target audience is ideal for site readers.

As another example: If somebody gave me a copy of VMWare for review I'd use it, review it and keep it - even if though it isn't free. (Although I'd switch back to Qemu if that were better in the future).

Steve

[ Parent ]

Re: Book Review: Perl for System Administration
Posted by aferreras (200.88.xx.xx) on Sun 27 Nov 2005 at 03:15

Your translation is right Steve..
but i`m with you, this site is for Systems Administrators not for sharing and the review fits here and will help a few of us that wanna buy a good book to help with the Administrators tasks.

( my English is a little hard to understand.... :) )

- ariel
ariel en BSDlatino . org
ariel en ferreras . info
http://ariel.BSDlatino.org

[ Parent ]