Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Rytis Sileika [Sileika R.]

Rating No ratings yet

Apress, 2010 by Rytis SileikaThe scope of the system administrator role has changed dramatically over the years. The number of systems supported by a single engineer has also increased. As such, it is impractical to handcraft each installation, and there is a need to automate as many tasks as possible. The structure of systems varies from organization to organization, therefore system administrators must be able to create their own management tools. Historically, the most popular programming languages for these tasks were UNIX shell and Perl. They served their purpose well, and I doubt they will ever cease to exist. However, the complexity of current systems requires new tools, and the Python programming language is one of them. Python is an object oriented programming language suitable for developing large-scale applications. Its syntax and structure make is very easy to read, so much so that the language is sometimes referred to as executable pseudocode. The Python interpreter allows for interactive execution, so in some situations, you can use it instead of a standard UNIX shell. Although Python is primarily an object-oriented language, you can easily adopt it for procedural and functional styles of programming. Given all that, Python makes a perfect fit as a new language for implementing system administration applications. There are a large number of Linux system utilities already written in Python, such as the Yum package manager and Anaconda, the Linux installation program.This book is about using the Python programming language to solve specific system administration tasks. We will look at the four distinctive system administration areas: network management, web server and web application management, database system management, and system monitoring. Although I will explain most of the technologies used in this book in detail, bear in mind that the main goal of this book is to show you the practical application of the Python libraries to solve rather specific

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
# Pro Python System Administration — Reading Guide ## 【One-Line Pitch】 A practical, project-driven guide for intermediate-to-advanced sysadmins who want to replace handcrafted shell scripts and Perl one-liners with maintainable Python tools for network, web, database, and monitoring automation. If you manage heterogeneous infrastructure and need custom management solutions, this book shows you how to build them with real code. ## 【Book Arc】 - **Opening (~0%–9%)**: Establishes why Python is the right tool for modern system administration — readable syntax, object-oriented design, interactive interpreter, and a rich module ecosystem. The author positions the book around four domains: network management, web server/application management, database management, and monitoring. - **Early (~18%–32%)**: Dives into network management fundamentals. Chapter 1 covers SNMP for reading performance data (using PySNMP and RRDTool for storage and graphing), and Chapter 2 introduces SOAP APIs for managing devices like Citrix Netscaler load balancers, including WSDL handling and connection management. - **Middle (~41%–55%)**: Shifts to web application development with Django. You build an IP address accountancy application (Chapter 3), integrate it with DHCP (Chapter 4), and create an Apache virtual host management tool (Chapter 5) — all with database models, URL routing, templates, and admin interfaces. - **Middle (~55%–59%)**: Moves into log analysis and monitoring. Chapter 6 covers building a plug-in framework for Apache log statistics, and the pattern continues into complex log searching and reporting (Chapter 7) plus a Nagios availability check script (Chapter 8). - **Late (~59%–100%)**: Covers the management/monitoring subsystem (Chapters 9–10), statistics gathering with NumPy (Chapter 11), automatic MySQL performance tuning (Chapter 12), and using Amazon EC2/S3 as a data warehouse (Chapter 13). The book ends with practical, deployable solutions. ## 【Key Takeaways】 - **Python is the modern sysadmin's scripting language** (Early): Unlike shell or Perl, Python's readability and object-oriented structure make it suitable for large-scale management tools. The interactive interpreter also lets you use it as a shell replacement. - **SNMP is the backbone of network performance monitoring** (Early): Using PySNMP, you can read system and interface variables, store time-series data in RRDTool round-robin databases, and generate graphs — a complete monitoring pipeline. - **SOAP APIs enable programmatic device management** (Early): For devices like Citrix Netscaler load balancers, WSDL schemas can be converted to Python helper modules, letting you log in, query health data, and manage services without manual CLI interaction. - **Django provides a full web framework for admin tools** (Middle): The Model-View-Template pattern lets you build database-backed applications (like IP address accountancy) with admin interfaces, URL routing, and template inheritance — far more maintainable than CGI scripts. - **DHCP integration requires careful data modeling** (Middle): Extending an IP management app to generate DHCP configuration files involves adding address pools, client classification rules, and URL reverse resolution — showing how web apps can drive network config generation. - **Plug-in frameworks make log analysis extensible** (Middle): By designing a plug-in architecture for Apache log processing, you can add new statistical analyses without rewriting the core application — a pattern worth copying for any data-processing tool. - **Monitoring subsystems need both agents and central collection** (Late): Remote monitoring agents (Chapter 10) feed data to a central management subsystem, and NumPy enables statistical computation for reporting — a two-tier architecture for scalable monitoring. - **Cloud services can offload heavy processing** (Late): Using Amazon EC2/S3 as a data warehouse solution shows how Python can orchestrate off-premises computation and storage, a forward-looking pattern for capacity-constrained environments. ## 【Reading Tips】 - **Skim the SNMP and SOAP theory sections** (Early): The protocol explanations are useful context, but the real value is in the PySNMP and SOAP client code — focus there if you're already familiar with these protocols. - **Deep-read the Django chapters (3–5)**: These form the core of the book's web application coverage. Pay special attention to URL configuration, template inheritance, and how the admin interface is customized — these patterns reappear in later chapters. - **Treat Chapter 6's plug-in framework as a reusable pattern**: Even if you don't process Apache logs, the plug-in architecture is a transferable design pattern for any extensible data-processing tool. - **Watch for the progression from single-purpose scripts to integrated systems**: The early chapters build standalone tools; the later chapters (9–13) show how to combine them into a cohesive management/monitoring subsystem. Read with that arc in mind. - **Skip the introductory Python material if you're experienced**: The book assumes intermediate Python knowledge; the value is in the system administration libraries and frameworks, not Python basics. ## 【Coverage Limits】 This guide covers the book's structure and key technical patterns based on the table of contents and early chapter excerpts. Detailed code walkthroughs, specific library APIs, and the full implementation of later chapters (Nagios integration, remote agents, MySQL tuning, EC2/S3) are not covered in this guide — the excerpts provide chapter titles and summaries but not full content. ##
Excerpt 1
nagement, database system management, and system monitoring. Although I will explain most of the technologies used in this book in detail, bear in mind that...
View in text
Page 7
............................................................ xvi ■About the Technical Reviewer..................................................................
View in text
Page 10
............................................................42 Requesting Services with SOAP ...................................................................
View in text
Page 11
ending the Database Schema....................................................................................109 Additions to the Workflow ....................
View in text
Page 13
...186 What Can We Find in a Typical Log File? ........................................................................186 The Structure of an Exception Stac...
View in text
Page 14
............................................................................................................255 Running Multiple Processes .....................
View in text
Page 16
..................334 Querying the Configuration Variables .............................................................................339 Querying the Serv...
View in text
Page 18
pecializing in system integration and deployment automation. His areas of interest and expertise are UNIX-based operating system management and automation to...
View in text
Tags
AI categories
PythonBackendCloud Native
ISBN: 1430226064
Publisher: Apress
Publish Year: 2010
Language: English
File Format: PDF
File Size: 7.1 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…