Pro Python System Administration 2nd Edition by Rytis Sileika – Ebook PDF Instant Download/Delivery: 148420218X, 9781484202180
Full download Pro Python System Administration 2nd Edition after payment
Product details:
ISBN 10: 148420218X
ISBN 13: 9781484202180
Author: Rytis Sileika
Pro Python System Administration, Second Edition explains and shows how to apply Python scripting in practice. It will show you how to approach and resolve real-world issues that most system administrators will come across in their careers. This book has been updated using Python 2.7 and Python 3 where appropriate. It also uses various new and relevant open source projects and tools that should now be used in practice. In this updated edition, you will find several projects in the categories of network administration, web server administration, and monitoring and database management. In each project, the author will define the problem, design the solution, and go through the more interesting implementation steps. Each project is accompanied by the source code of a fully working prototype, which you’ll be able to use immediately or adapt to your requirements and environment. This book is primarily aimed at experienced system administrators whose day-to-day tasks involve looking after and managing small-to-medium-sized server estates. It will also be beneficial for system administrators who want to learn more about automation and want to apply their Python knowledge to solve various system administration problems. Python developers will also benefit from reading this book, especially if they are involved in developing automation and management tools.
Pro Python System Administration 2nd Table of contents:
Chapter 1: Reading and Collecting Performance Data Using SNMP
Application Requirements and Design
Specifying the Requirements
High-Level Design Specification
Introduction to SNMP
The System SNMP Variables Node
The Interfaces SNMP Variables Node
Authentication in SNMP
Querying SNMP from the Command Line
Querying SNMP Devices from Python
Configuring the Application
Using the PySNMP Library
The SNMP GET Command
The SNMP SET Command
The SNMP GETNEXT Command
Implementing the SNMP Read Functionality
Storing Data with RRDTool
Introduction to RRDTool
Using RRDTool from a Python Program
Creating a Round Robin Database
Writing and Reading Data from the Round Robin Database
Plotting Graphs with RRDTool
Integrating RRDTool with the Monitoring Solution
Creating Web Pages with the Jinja2 Templating System
Loading Template Files with Jinja2
The Jinja2 Template Language
Accessing Variables
Flow Control Statements
Generating Website Pages
Summary
Chapter 2: Managing Devices Using the SOAP API
What Is the SOAP API?
The Structure of a SOAP Message
Requesting Services with SOAP
Finding Information About Available Services with WSDL
SOAP Support in Python
Converting WSDL Schema to Python Helper Module
Defining Requirements for Our Load Balancer Tool
Basic Requirements
Code Structure
Configuration
Accessing Citrix Netscaler Load Balancer with the SOAP API
Fixing Issues with Citrix Netscaler WSDL
Creating a Connection Object
Logging In: Our First SOAP Call
Finding What Is Being Returned in the Response
How Is the Session Maintained After We Have Logged On?
Gathering Performance Statistics Data
SOAP Methods for Reading Statistical Data and its Return Values
Reading System Health Data
Reading Service Status Data
Automating Some Administration Tasks
Device Configuration SOAP Methods
Setting a Service State
A Word About Logging and Error Handling
Using the Python Logging Module
Logging Levels and Scope
Configuring and Using the Logger
Handling Exceptions
NetScaler NITRO API
Download
Using the Nitro-Python Module
Module Layout
Logging On
Gathering Statistical Data
Performing Administration Tasks
Summary
Chapter 3: Creating a Web Application for IP Address Accountancy
Designing the Application
Setting out the Requirements
Making Design Decisions
Defining the Database Schema
Creating the Application Workflow
The Search and Display Functions
The Add Function
The Delete Function
The Modify Function
The System Health Check Function
The Name Resolution Function
The Basic Concepts of the Django Framework
What Is Django?
The Object-to-Relation Database Mapper?
The Administration Interface
A Flexible Template System
Open-Source Community Support
The Model/View/Controller Pattern
The Data Model Component
The View Component
The Controller Component
Installing the Django Framework
The Structure of a Django Application
Using Django with Apache Web Server
Implementing Basic Functionality
Defining the Database Model
URL Configuration
Using the Management Interface
Enabling the Management Interface
Allowing the Administration Plug-in to Manage New Models
Viewing Records
Using Templates
Deleting Records
Adding New Records
Modifying Existing Records
Summary
Chapter 4: Integrating the IP Address Application with DHCP
Extending the Design and Requirements
Extending the Database Schema
Making Additions to the Workflow
Adding DHCP Network Data
The Data Models
Additional Workflows
The Add Function
The Modify Function
The Delete Function
Extending the DHCP Configuration with Address Pools
The Address Pool Data Model
The DHCP Network Details
The Add and Delete Functions
Reworking the URL Structure
Generation of URLs in the Model Class
Reverse Resolution of URLs
Assignment of Names to URL Patterns
Use of URL References in the Templates
Adding Client Classification
Additions to the Data Model
Template Inheritance
Class Rules Management
Generic Views
Display of a List of Objects
Detailed View of the Object
New Objects Added or Modified
Deletion of Objects
Generating the DHCP Configuration File
Other Modifications
Resolving IPs to Hostnames
Checking Whether the Address Is in Use
Dynamic DHCP Lease Management
Employ Python Interface to OMAPI
Set up the ISC DHCP Server
Add a New Host Lease Record
Delete a Host Lease Record
Summary
Chapter 5: Maintaining a List of Virtual Hosts in an Apache Configuration File
Specifying the Design and Requirements for the Application
Functional Requirements
High-Level Design
Setting Up the Environment
Apache Configuration
Creating a Django Project and Application
Configuring the Application
Defining the URL Structure
The Data Model
The Basic Model Structure
Modifying the Administration Interface
Improving the Class and Object Lists
Customizing the Class Names
Adding New Fields to the Object List
Reorganizing the Form Fields
Adding Custom Object Actions
Generating the Configuration File
Summary
Chapter 6: Gathering and Presenting Statistical Data from Apache Log Files
Application Structure and Functionality
Application Requirements
Application Design
Plug-in Framework Implementation in Python
The Mechanics of a Plug-in Framework
Interface Model
Plug-in Registration and Discovery
Creating the Plug-in Framework
Discovery and Registration
Defining the Plug-in Modules
Log-Parsing Application
Format of Apache Log Files
Log File Reader
Calling the Plug-in Methods
Tagging the Plug-in Classes
Plug-in Methods and the Call Mechanism
Plug-in Modules
Installing the Required Libraries
Using the GeoIP Python Bindings
Writing the Plug-in Code
Visualizing the Data
Installing Required Libraries and Data Files
Working with Shapefile
Displaying the Requests Data on the World Map
Summary
Chapter 7: Performing Complex Searches and Reporting on Application Log Files
Defining the Problem
Why We Use Exceptions
Are Exceptions Always a Bad Sign?
Why We Should Analyze Exceptions
Parsing Complex Log Files
What Can We Find in a Typical Log File?
The Structure of an Exception Stack Trace Log
Handling Multiple Files
Handling Multiple Files
Using the Built-in Bzip2 Library
Traversing Large Data Files
What Are Generators, and How Are They Used?
Detecting the Exceptions
Detecting the Potential Candidates
Filtering the Legitimate Exception Traces
Storing Data in Data Structures
The Structure of Exception Stack Trace Data
Generating an Exception Fingerprint for Unknown Exceptions
Detecting Known Exceptions
The Configuration File
Parsing XML Files with Python
Storing and Applying Filters
The Benefits of a Precompiled Search over a Plain-Text Search
Producing Reports
Grouping the Exceptions
Producing Differently Formatted Outputs for the Same Dataset
Calculating Group Statistics
Summary
Chapter 8: A Website Availability Check Script for Nagios
Requirements for the Check System
The Nagios Monitoring System
Nagios Plug-In Architecture
The Site Navigation Check
Installing the Beautiful Soup HTML Parsing Library
Retrieving a Web Page
Parsing the HTML Pages with Beautiful Soup
Adding the New Check to the Nagios System
Emulating the User Login Process
Simplifying HTTP Client with Requests Module
Installing Requests Library
Basic Usage
Rewriting Site Logon Check Script
Summary
Chapter 9: Management and Monitoring Subsystem
Design
The Components
The Monitoring Server
The Monitoring Agent
The Sensors
The Data Objects
Configuration
Performance Readings
Site Configuration
Scheduling
The Data Structures
Introduction to Data Normalization
Configuration Data
Performance Data
Scheduling
Site Configuration
Representing the Information in an ER Diagram
Communication Flows
XML-RPC for Information Exchange
Structure
Python Support
CherryPy
The Server Process
Storing Data in a SQLite3 Database
Initializing the Database File
Actions
Accepting Sensor Readings
Supplying a New Configuration
Providing New Sensor Code
The Server Health Check
The Scheduler
Actions
Running Multiple Processes
Multithreading, Multiprocessing, and GIL
Basic Usage Patterns and Examples
Running Methods at Equal Intervals
A Simple Clock Implementation
A Cron-Like Scheduler
Ticket Dispatcher
Summary
Chapter 10: Remote Monitoring Agents
Design
The Passive Component
Architecture
Actions
Accepting a New Configuration
Upgrading the Sensors
Submitting Sensor Readings
The Security Model
Configuration
The ConfigParser Library
The File Format
Using the ConfigParser Class Methods
The Configuration Class Wrapper
The Sensor Design
Running External Processes
Using the Subprocess Library
Controlling the Running Processes
Communicating with External Processes
Using File Descriptors
Using File Objects
Using the Pipe Objects
Redirecting Standard Error
Automatically Updating Sensor Code
Sending and Receiving Binary Data with XML-RPC
Working with Files and Archives (TAR and BZip2)
Summary
Chapter 11: Statistics Gathering and Reporting
Application Requirements and Design
Using the NumPy Library
Installing NumPy
NumPy Examples
Working with Arrays
Basic Mathematical and Statistical Operations
Calculating the Mean and Standard Deviation
Finding the Trend Line of a Dataset
Reading and Writing Data to Files
Representing Data with matplotlib
Installing matplotlib
Understanding the Library Structure
Plotting Graphs
Changing the Appearance of the Plot Primitives
Drawing Bars and Using Multiple Axes
Working with Text Strings
Saving Plots to a File
Graphing Statistical Data
Collating Data from the Database
Displaying Available Hosts
Drawing Timescale Graphs
The Index Page
Host Details Page
Graph Collection Pages
Plotting Performance Graphs
Summary
Chapter 12: Distributed Message Processing System
Quick Introduction to Message and Task Queues
Task Queuing Systems
Message Queuing Systems
Setting up the Celery Server and Client
Installing and Setting up RabbitMQ
Installing and Setting up Celery
Create Celery System User and Group
Create Celery Project Directory and Sample Application
Create Required System Directories
Create Systemd Configuration Files
Test Access to the Celery Server
Celery Basics
Layout of a Typical Celery Application
Creating a Tasks Module
Worker and Master Process Application Files
Overview of the Celery Configuration File
The Main Celery Application File
Celery Tasks
Systemd Configuration
Celery Master Application
Routing Tasks
Inside a Message Queue System
Binding Worker Node to Specific Queues
Sending Broadcast Messages
Summary
Chapter 13: Automatic MySQL Database Performance Tuning
Requirements Specification and Design
Basic Application Requirements
System Design
Modifying the Plug-in Framework
Changes to the Host Application
Modifying the Plug-in Manager
Writing the Producer Plug-ins
Accessing the MySQL Database from Python Applications
Querying the Configuration Variables
Querying the Server Status Variables
Collecting the Host Configuration Data
Writing the Consumer Plug-ins
Checking the MySQL Version
Checking the Key Buffer Size Setting
Checking the Slow Queries Counter
Summary
Chapter 14: Using Amazon EC2/S3 as a Data Warehouse Solution
Specifying the Problem and the Solution
The Problem
Our Solution
Design Specifications
The Amazon EC2 and S3 Crash Course
Authentication and Security
Account Identifier
Access Credentials
X.509 Certificates
EC2 Key Pair
The Simple Storage System Concepts
The Elastic Computing Cloud Concepts
Amazon Machine Images and Instances
Elastic Block Store
Security Groups
Elastic IPs and Load Balancers
User Interfaces
Creating a Custom EC2 Image
Reusing Existing Images
Making Modifications
Install the Additional Packages
Create and Set Up an Elastic Block Store Volume
Configure the MySQL Instance
Bundling the New AMI
Controlling the EC2 Using the Boto Python Module
Setting Up the Configuration Variables
Initializing the EC2 Instance Programmatically
Launching the EC2 Instance
Attaching the EBS Volume
Mounting the EBS Device
Starting the MySQL Instance
Transferring the Data
Destroying the EC2 Instance Programmatically
Shutting Down the MySQL Instance
Unmounting the File System
Detaching the EBS Volume
Taking a Snapshot of the Volume
Shutting Down the Instance
The Control Sequence
People also search for Pro Python System Administration 2nd:
8 python
3 python project
system administration with python
windows administration with python
Tags:
Rytis Sileika,Python,System,Administration