使用Perl实现系统管理自动化(第二版,影印版)
使用Perl实现系统管理自动化(第二版,影印版)
David N. Blank-Edelman
出版时间:2009年12月
页数:639
如果你从事任何系统管理方面的工作,就必须应对日益复杂的工作环境以及对你的时间不断增加的需求。《使用Perl实现系统管理自动化 第二版》不仅提供了可用于工作的恰当工具,还给出了许多建议,帮助你解决特定问题以及安全地自动处理重复事务。
这一版的“水獭书”经过更新和扩充,涵盖了最新的操作系统、技术和Perl模块,将会帮助你:
* 管理用户账户
* 监测文件系统和进程
* 处理XML和YAML等格式的配置文件
* 使用DBI管理数据库,包括MySQL、MS SQL和Oracle
* 处理LDAP和Active Directory等目录服务
* 编写脚本管理电子邮件协议和垃圾邮件
* 高效地创建、处理和分析日志文件
* 管理网络名称和配置服务,包括NIS、DNS和DHCP
* 维护、监测和映射网络服务
* 提高文件系统、进程和网络的安全性
这一版的附录中还包含了额外内容,帮助你快速掌握XML/XPath、LDAP、SNMP和SQL等技术。本书在手并结合Perl,你将花费更少的资源,付出更少的劳动,大大减少烦恼,让你事半功倍。
  1. Preface
  2. 1. Introduction
  3. Automation Is a Must
  4. How Perl Can Help You
  5. This Book Will Show You How
  6. What You Need
  7. Some Notes About the Perl Versions Used for This Book
  8. What About Perl 5.10?
  9. What About Strawberry Perl?
  10. What About Perl 6?
  11. Some Notes About Using Vista with the Code in This Book
  12. Locating and Installing Modules
  13. Installing Modules on Unix
  14. Installing Modules on Win32
  15. It’s Not Easy Being Omnipotent
  16. Don’t Do It
  17. Drop Your Privileges As Soon As Possible
  18. Be Careful When Reading Data
  19. Be Careful When Writing Data
  20. Avoid Race Conditions
  21. Enjoy
  22. References for More Information
  23. 2. Filesystems
  24. Perl to the Rescue
  25. Filesystem Differences
  26. Unix
  27. Windows-Based Operating Systems
  28. Mac OS X
  29. Filesystem Differences Summary
  30. Dealing with Filesystem Differences from Perl
  31. Walking or Traversing the Filesystem by Hand
  32. Walking the Filesystem Using the File::Find Module
  33. Walking the Filesystem Using the File::Find::Rule Module
  34. Manipulating Disk Quotas
  35. Editing Quotas with edquota Trickery
  36. Editing Quotas Using the Quota Module
  37. Editing NTFS Quotas Under Windows
  38. Querying Filesystem Usage
  39. Module Information for This Chapter
  40. References for More Information
  41. 3. User Accounts
  42. Unix User Identities
  43. The Classic Unix Password File
  44. Changes to the Password File in BSD 4.4 Systems
  45. Shadow Passwords
  46. Windows-Based Operating System User Identities
  47. Windows User Identity Storage and Access
  48. Windows User ID Numbers
  49. Windows Passwords Don’t Play Nice with Unix Passwords
  50. Windows Groups
  51. Windows User Rights
  52. Building an Account System to Manage Users
  53. The Backend Database
  54. The Low-Level Component Library
  55. The Process Scripts
  56. Account System Wrap-Up
  57. Module Information for This Chapter
  58. References for More Information
  59. Unix Password Files
  60. Windows User Administration
  61. 4. User Activity
  62. Process Management
  63. Windows-Based Operating System Process Control
  64. Unix Process Control
  65. File and Network Operations
  66. Tracking File Operations on Windows
  67. Tracking Network Operations on Windows
  68. Tracking File and Network Operations in Unix
  69. Module Information for This Chapter
  70. Installing Win32::Setupsup
  71. References for More Information
  72. 5. TCP/IP Name and Configuration Services
  73. Host Files
  74. Generating Host Files
  75. Error-Checking the Host File Generation Process
  76. Improving the Host File Output
  77. Incorporating a Source Code Control System
  78. NIS, NIS+, and WINS
  79. NIS+
  80. Windows Internet Name Server (WINS)
  81. Domain Name Service (DNS)
  82. Generating DNS (BIND) Configuration Files
  83. DNS Checking: An Iterative Approach
  84. DHCP
  85. Active Probing for Rogue DHCP Servers
  86. Monitoring Legitimate DHCP Servers
  87. Module Information for This Chapter
  88. References for More Information
  89. 6. Working with Configuration Files
  90. Configuration File Formats
  91. Binary
  92. Naked Delimited Data
  93. Key/Value Pairs
  94. Markup Languages
  95. All-in-One Modules
  96. Advanced Configuration Storage Mechanisms
  97. Module Information for This Chapter
  98. References for More Information
  99. XML and YAML
  100. 7. SQL Database Administration
  101. Interacting with a SQL Server from Perl
  102. Using the DBI Framework
  103. Using ODBC from Within DBI
  104. Server Documentation
  105. MySQL Server via DBI
  106. Oracle Server via DBI
  107. Microsoft SQL Server via ODBC
  108. Database Logins
  109. Monitoring Space Usage on a Database Server
  110. Module Information for This Chapter
  111. References for More Information
  112. DBI
  113. Microsoft SQL Server
  114. ODBC
  115. Oracle
  116. 8. Email
  117. Sending Mail
  118. Getting sendmail (or a Similar Mail Transport Agent)
  119. Using the OS-Specific IPC Framework to Drive a Mail Client
  120. Speaking the Mail Protocols Directly
  121. Common Mistakes in Sending Email
  122. Overzealous Message Sending
  123. Subject Line Waste
  124. Insufficient Information in the Message Body
  125. Fetching Mail
  126. Talking POP3 to Fetch Mail
  127. Talking IMAP4rev1 to Fetch Mail
  128. Processing Mail
  129. Dissecting a Single Message
  130. Dissecting a Whole Mailbox
  131. Dealing with Spam
  132. Support Mail Augmentation
  133. Module Information for This Chapter
  134. References for More Information
  135. 9. Directory Services
  136. What’s a Directory?
  137. Finger: A Simple Directory Service
  138. The WHOIS Directory Service
  139. LDAP: A Sophisticated Directory Service
  140. LDAP Programming with Perl
  141. The Initial LDAP Connection
  142. Performing LDAP Searches
  143. Entry Representation in Perl
  144. Adding Entries with LDIF
  145. Adding Entries with Standard LDAP Operations
  146. Deleting Entries
  147. Modifying Entry Names
  148. Modifying Entry Attributes
  149. Deeper LDAP Topics
  150. Putting It All Together
  151. Active Directory Service Interfaces
  152. ADSI Basics
  153. Using ADSI from Perl
  154. Dealing with Container/Collection Objects
  155. Identifying a Container Object
  156. So How Do You Know Anything About an Object?
  157. Searching
  158. Performing Common Tasks Using the WinNT and LDAP Namespaces
  159. Working with Users via ADSI
  160. Working with Groups via ADSI
  161. Working with File Shares via ADSI
  162. Working with Print Queues and Print Jobs via ADSI
  163. Working with Windows-Based Operating System Services via ADSI
  164. Module Information for This Chapter
  165. References for More Information
  166. LDAP
  167. ADSI
  168. 10. Log Files
  169. Reading Text Logs
  170. Reading Binary Log Files
  171. Using unpack()
  172. Calling an OS (or Someone Else’s) Binary
  173. Using the OS’s Logging API
  174. Structure of Log File Data
  175. Dealing with Log File Information
  176. Space Management of Logging Information
  177. Log Parsing and Analysis
  178. Writing Your Own Log Files
  179. Logging Shortcuts and Formatting Help
  180. Basic/Intermediate Logging Frameworks
  181. Advanced Logging Framework
  182. Module Information for This Chapter
  183. References for More Information
  184. 11. Security
  185. Noticing Unexpected or Unauthorized Changes
  186. Local Filesystem Changes
  187. Changes in Data Served Over the Network
  188. Noticing Suspicious Activities
  189. Local Signs of Peril
  190. Finding Problematic Patterns
  191. Danger on the Wire, or “Perl Saves the Day”
  192. Preventing Suspicious Activities
  193. Suggest Better Passwords
  194. Reject Bad Passwords
  195. Module Information for This Chapter
  196. References for More Information
  197. 12. SNMP
  198. Using SNMP from Perl
  199. Sending and Receiving SNMP Traps, Notifications, and Informs
  200. Alternative SNMP Programming Interfaces
  201. Module Information for This Chapter
  202. References for More Information
  203. 13. Network Mapping and Monitoring
  204. Network Mapping
  205. Discovering Hosts
  206. Discovering Network Services
  207. Physical Location
  208. Presenting the Information
  209. Textual Presentation Tools
  210. Graphical Presentation Tools
  211. Monitoring Frameworks
  212. Extending Existing Monitoring Packages
  213. What’s Left?
  214. Module Information for This Chapter
  215. References for More Information
  216. 14. Experiential Learning
  217. Playing with Timelines
  218. Task One: Parsing crontab Files
  219. Task Two: Displaying the Timeline
  220. Task Three: Writing Out the Correct XML File
  221. Putting It All Together
  222. Summary: What Can We Learn from This?
  223. Playing with Geocoding
  224. Geocoding from Postal Addresses
  225. Geocoding from IP Addresses
  226. Summary: What Can We Learn from This?
  227. Playing with an MP3 Collection
  228. Summary: What Can We Learn from This?
  229. One Final Exploration
  230. Part One: Retrieving the Wiki Page with WWW::Mechanize
  231. Part Two: Extracting the Data
  232. Part Three: Geocoding and Mapping the Data
  233. Summary: What Can We Learn from This?
  234. Remember to Play
  235. Module Information for This Chapter
  236. Source Material for This Chapter
  237. A. The Eight-Minute XML Tutorial
  238. B. The 10-Minute XPath Tutorial
  239. C. The 10-Minute LDAP Tutorial
  240. D. The 15-Minute SQL Tutorial
  241. E. The Five-Minute RCS Tutorial
  242. F. The Two-Minute VBScript-to-Perl Tutorial
  243. G. The 20-Minute SNMP Tutorial
  244. Index
书名:使用Perl实现系统管理自动化(第二版,影印版)
国内出版社:东南大学出版社
出版时间:2009年12月
页数:639
书号:978-7-5641-1928-7
原版书出版商:O'Reilly Media
David N. Blank-Edelman
 
David N. Blank-Edelman 是美国东北大学计算机和信息科学学院的技术总监。他在大型跨平台的系统/网络管理方面有二十五年的经验,其中包括在布兰迪斯大学、剑桥技术集团以及麻省理工学院媒体实验室的历练。他还是 Large Installation System Administration(LISA)大会 2005 年的主席,也是 2006 年的特约演讲者和联合主席。
 
 
The animal on the cover of Automating System Administration with Perl, Second Edition,
is a sea otter. North American sea otters make their homes along the Pacific coast,
near the kelp beds containing the shellfish that make up the majority of their diet. Sea
otters can be found in great numbers in Alaska and on beaches as far south as California.
Sea otters are agile, intelligent mammals and are known to make ingenious use of tools.
Floating on their backs, they hold a shellfish such as a mussel or abalone on their bellies
and use a rock to break the shell.
Intensely social, sea otters gather to float in groups called rafts. They are excellent
swimmers, propelling themselves swiftly through the water with their flipper-like,
webbed back paws. Their thick fur provides them with efficient insulation in the water.
At times, their existence has been threatened as they have been mercilessly hunted to
near extinction for their fur.