مشخصات کتاب
-
Jason Brittain and Ian F. Darwin
-
2008
-
انگلیسی
-
4685
-
487
-
0
Python for Unix and Linux System Administration
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Why Python? 1
Motivation 6
The Basics 8
Executing Statements in Python 8
Using Functions in Python 12
Reusing Code with the Import Statement 16
2. IPython . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Installing IPython 22
Basic Concepts 23
Help with Magic Functions 30
Unix Shell 34
Information Gathering 51
Automation and Shortcuts 64
Summary 69
3. Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Python Built-ins and Modules 71
Log Parsing 110
ElementTree 116
Summary 120
4. Documentation and Reporting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Automated Information Gathering 123
Manual Information Gathering 126
Information Formatting 135
5. Networking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Network Clients 147
Remote Procedure Call Facilities 158
SSH 164
Twisted 167
Scapy 173
Creating Scripts with Scapy 175
6. Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
Introduction 177
Using the OS Module to Interact with Data 178
Copying, Moving, Renaming, and Deleting Data 179
Working with Paths, Directories, and Files 181
Comparing Data 185
Merging Data 187
Pattern Matching Files and Directories 193
Wrapping Up rsync 195
Metadata: Data About Data 197
Archiving, Compressing, Imaging, and Restoring 199
Using tarfile Module to Create TAR Archives 199
Using a tarfile Module to Examine the Contents of TAR Files 201
7. SNMP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
Introduction 205
Brief Introduction to SNMP 205
IPython and Net-SNMP 208
Discovering a Data Center 211
Retrieving Multiple-Values with Net-SNMP 214
Creating Hybrid SNMP Tools 220
Extending Net-SNMP 222
SNMP Device Control 224
Enterprise SNMP Integration with Zenoss 225
8. OS Soup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Introduction 227
Cross-Platform Unix Programming in Python 228
PyInotify 238
OS X 240
Red Hat Linux Systems Administration 245
Ubuntu Administration 245
Foundations of Python Network Programming
نویسنده: Brandon Rhodes John Goerzen
زبان: انگلیسی