Helping ordinary people create extraordinary websites!
GET OUR NEWSLETTER
Your Email:
 

Cultured Perl: Automating UNIX System Administration with Perl

By Teodor Zlatanov
2004-07-15


A Centralized Configuration File Strategy

UNIX system administration, always a thorny problem, is easier with the right tools. In this installment, Teodor presents ideas on the use of Perl to streamline and foolproof system administration. The system configuration engine, cfengine, is an extremely important tool in this context.

To follow the exercises in this article, you must have Perl 5.6.0 installed on your system. Preferably, your system should be a recent (2000 or later) mainstream UNIX installation (Linux, Solaris, BSD). The examples may work with earlier versions of Perl and UNIX and with and other operating systems, but you should consider their potential failure to function as an exercise to solve.

A big reason that UNIX administration is challenging is that every UNIX vendor believes standards are for weak-minded fools. Thus, even operating systems from the same vendor (SunOS 4.x and Solaris 5.x) can be fundamentally different. In some instances, a vendor doesn't even exist. Linux, for example, has no single vendor (although Red Hat is currently the biggest Linux distribution), and every subtype of Linux has its own quirks. POSIX standardization is a step in the right direction to solving this problem, when it's done right. Unfortunately it only guarantees a small subset of the functionality needed for system administration.

As I've often said: know your tools. System administration can be a nightmare if you try to do everything with one single tool, language, or approach. Be flexible.

If there is one system administration truism, it is this: no simple sysadmin task is fun more than twice. If you find yourself doing a simple dull task more than twice, automate it. Of course, sometimes it's hard to automate things, but you should at least consider the option and weigh its advantages against the time you will spend automating it.

Tutorial Pages:
» A Centralized Configuration File Strategy
» The Tool Cfengine
» Configuration File Management
» Task Automation
» Summary
» Resources


First published by IBM DeveloperWorks


 | Bookmark
Related Tutorials:
» Random subroutines in Perl
» Log Script Use
» Creating Perl Modules for Web Sites
» Bit Vector, Using Perl Vec
» Build a Perl/CGI Voting System
» Perl Range Operator

Advertise with Us!


Tutorials Scripts Web Hosting Developer Manuals
Resources