If you do systems administration work of any kind, you have to deal with the growing complexity of your environment and increasing demands on your time. Automating System Administration with Perl, Second Edition, not only offers you the right tools for your job, but also suggests the best way to approach specific problems and to securely automate recurring tasks. Updated and expanded to cover the latest operating systems, technologies, and Perl modules, this edition of the "Otter Book" will help you:
- Manage user accounts
- Monitor filesystems and processes
- Work with configuration files in important formats such as XML and YAML
- Administer databases, including MySQL, MS-SQL, and Oracle with DBI
- Work with directory services like LDAP and Active Directory
- Script email protocols and spam control
- Effectively create, handle, and analyze log files
- Administer network name and configuration services, including NIS, DNS and DHCP
- Maintain, monitor, and map network services, using technologies and tools such as SNMP, nmap, libpcap, GraphViz and RRDtool
- Improve filesystem, process, and network security
This edition includes additional appendixes to get you up to speed on technologies such as XML/XPath, LDAP, SNMP, and SQL. With this book in hand and Perl in your toolbox, you can do more with less -- fewer resources, less effort, and far less hassle.
Inhaltsverzeichnis
Dedication;
Preface;
What's New in This Edition? ;
How This Book Is Structured;
Typographical Conventions;
Operating System Naming Conventions;
Coding Conventions;
Using Code Examples;
How to Contact Us;
Safari® Books Online;
Acknowledgments from the First Edition;
Acknowledgments for the Second Edition;
Chapter 1: Introduction;
1. 1 Automation Is a Must;
1. 2 How Perl Can Help You;
1. 3 This Book Will Show You How;
1. 4 What You Need;
1. 5 Some Notes About the Perl Versions Used for This Book;
1. 6 Some Notes About Using Vista with the Code in This Book;
1. 7 Locating and Installing Modules;
1. 8 It's Not Easy Being Omnipotent;
1. 9 References for More Information;
Chapter 2: Filesystems;
2. 1 Perl to the Rescue;
2. 2 Filesystem Differences;
2. 3 Walking or Traversing the Filesystem by Hand;
2. 4 Walking the Filesystem Using the File::Find Module;
2. 5 Walking the Filesystem Using the File::Find::Rule Module;
2. 6 Manipulating Disk Quotas;
2. 7 Editing NTFS Quotas Under Windows;
2. 8 Querying Filesystem Usage;
2. 9 Module Information for This Chapter;
2. 10 References for More Information;
Chapter 3: User Accounts;
3. 1 Unix User Identities;
3. 2 Windows-Based Operating System User Identities;
3. 3 Building an Account System to Manage Users;
3. 4 Module Information for This Chapter;
3. 5 References for More Information;
Chapter 4: User Activity;
4. 1 Process Management;
4. 2 File and Network Operations;
4. 3 Module Information for This Chapter;
4. 4 References for More Information;
Chapter 5: TCP/IP Name and Configuration Services;
5. 1 Host Files;
5. 2 NIS, NIS+, and WINS;
5. 3 Domain Name Service (DNS);
5. 4 DHCP;
5. 5 Module Information for This Chapter;
5. 6 References for More Information;
Chapter 6: Working with Configuration Files;
6. 1 Configuration File Formats;
6. 2 All-in-One Modules;
6. 3 Advanced Configuration Storage Mechanisms;
6. 4 Module Information for This Chapter;
6. 5 References for More Information;
Chapter 7: SQL Database Administration;
7. 1 Interacting with a SQL Server from Perl;
7. 2 Using the DBI Framework;
7. 3 Using ODBC from Within DBI;
7. 4 Server Documentation;
7. 5 Database Logins;
7. 6 Monitoring Space Usage on a Database Server;
7. 7 Module Information for This Chapter;
7. 8 References for More Information;
Chapter 8: Email;
8. 1 Sending Mail;
8. 2 Common Mistakes in Sending Email;
8. 3 Fetching Mail;
8. 4 Processing Mail;
8. 5 Module Information for This Chapter;
8. 6 References for More Information;
Chapter 9: Directory Services;
9. 1 What's a Directory? ;
9. 2 Finger: A Simple Directory Service;
9. 3 The WHOIS Directory Service;
9. 4 LDAP: A Sophisticated Directory Service;
9. 5 Active Directory Service Interfaces;
9. 6 Module Information for This Chapter;
9. 7 References for More Information;
Chapter 10: Log Files;
10. 1 Reading Text Logs;
10. 2 Reading Binary Log Files;
10. 3 Structure of Log File Data;
10. 4 Dealing with Log File Information;
10. 5 Writing Your Own Log Files;
10. 6 Module Information for This Chapter;
10. 7 References for More Information;
Chapter 11: Security;
11. 1 Noticing Unexpected or Unauthorized Changes;
11. 2 Noticing Suspicious Activities;
11. 3 Danger on the Wire, or "Perl Saves the Day";
11. 4 Preventing Suspicious Activities;
11. 5 Module Information for This Chapter;
11. 6 References for More Information;
Chapter 12: SNMP;
12. 1 Using SNMP from Perl;
12. 2 Module Information for This Chapter;
12. 3 References for More Information;
Chapter 13: Network Mapping and Monitoring;
13. 1 Network Mapping;
13. 2 Presenting the Information;
13. 3 Monitoring Frameworks;
13. 4 What's Left? ;
13. 5 Module Information for This Chapter;
13. 6 References for More Information;
Chapter 14: Experiential Learning;
14. 1 Playing with Timelines;
14. 2 Playing with Geocoding;
14. 3 Playing with an MP3 Collection;
14. 4 One Final Exploration;
14. 5 Remember to Play;
14. 6 Module Information for This Chapter;
14. 7 Source Material for This Chapter;
The Eight-Minute XML Tutorial;
XML Is a Markup Language;
XML Is Picky;
Two Key XML Terms;
Leftovers;
References for More Information;
The 10-Minute XPath Tutorial;
XPath Basic Concepts;
References for More Information;
The 10-Minute LDAP Tutorial;
LDAP Data Organization;
The 15-Minute SQL Tutorial;
Creating/Deleting Databases and Tables;
Inserting Data into a Table;
Querying Information;
Changing Table Information;
Relating Tables to Each Other;
SQL Stragglers;
The Five-Minute RCS Tutorial;
References for More Information;
The Two-Minute VBScript-to-Perl Tutorial;
Translation Tactics;
References for More Information;
The 20-Minute SNMP Tutorial;
SNMP in Practice;
Colophon;