Automating System Administration with Perl: Tools to Make You More Efficient

Automating System Administration with Perl: Tools to Make You More Efficient

David N. Blank-Edelman

Language: English

Pages: 670

ISBN: 059600639X

Format: PDF / Kindle (mobi) / ePub

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.

Python Cookbook (2nd Edition)

Learning Java (4th Edition)

PC Today (April 2012)

Windows PowerShell Cookbook (3rd Edition)

Learn C the Hard Way: Practical Exercises on the Computational Subjects You Keep Avoiding (Like C)















": $!\n"; next; } warn $pwent->name . ''s homedir is not owned by the correct uid (' . $dirinfo->uid . ' instead ' . $pwent->uid . ")!\n" if ( $dirinfo->uid != $pwent->uid ); # world writable is fine if dir # see the manual page for chmod warn $pwent->name . "'s homedir if ( $dirinfo->mode & 022 and } endpwent(); is set "sticky" (i.e., 01000); for more information is world-writable!\n" ( !$dirinfo->mode & 01000 ) ); This code looks a bit different from our previous parsing code because it uses.

The Local Security Policy Editor’s broken interface, described earlier: instead of matching users to rights, we can match rights to users. If we use Win32::Lanman::LsaEnumerateAccountsWithUserRight(), we can retrieve a list of SIDs that have a specific user right. Enumerating this list could be useful in certain situations. Building an Account System to Manage Users Now that we’ve had a good look at user identities, we can begin to address the administration aspect of user accounts. Rather than.

For some help with that task. • Our samples hide the opaqueness of the debugging process. When WMI-related Perl code fails (especially code of the object-oriented flavor), it provides very little information that would help you debug the problem. You may receive error messages, but they never say ERROR: YOUR EXACT PROBLEM IS.... You’re more likely to † As much as Microsoft would like to see these data access mechanisms become ubiquitous, the likelihood of finding them in a non-Win32 environment.

Repository, known as the Network Information Center (NIC)—or more precisely, the SRI-NIC, since it was housed at the Stanford Research Institute at the time—updated and published a host file for the entire network called HOSTS.TXT. To remain up-to-date, system administrators anonymously FTP’d this file from SRI-NIC’s NETINFO directory on a regular basis. Host files are still in use today, despite their limitations and the availability of the replacements we’ll be talking about later in this.

Defined $addrs{ $record->{address} } ) { warn '!!!! Duplicate IP addr:' . $record->{name} . ' & ' . $addrs{ $record->{address} } . ", skipping...\n"; next; } else { $addrs{ $record->{address} } = $record->{name}; } } $entries{ $record->{name} } = $record; } close $DATAFILE; # add this to a hash of hashes # print a nice header print "#\n# host file - GENERATED BY $0\n# DO NOT EDIT BY HAND!\n#\n"; print "# Converted by $user on " . scalar(localtime) . "\n#\n"; # count the number of entries in.

Download sample