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

By David N. Blank-Edelman

If you do structures management paintings of any variety, you want to take care of the starting to be complexity of your atmosphere and extending calls for in your time. Automating method management with Perl, moment version, not just provide you with the precise instruments on your task, but in addition indicates how to strategy particular difficulties and to safely automate ordinary initiatives. up to date and extended to hide the most recent working structures, applied sciences, and Perl modules, this version of the "Otter booklet" may also help you:
  • deal with person bills
  • Monitor filesystems and methods
  • Work with configuration documents in vital codecs corresponding to XML and YAML
  • Administer databases, together with MySQL, MS-SQL, and Oracle with DBI
  • Work with listing prone like LDAP and energetic listing
  • Script e-mail protocols and unsolicited mail regulate
  • Effectively create, deal with, and learn log documents Administer community identify and configuration companies, together with NIS, DNS and DHCP
  • Maintain, visual display unit, and map community companies, utilizing applied sciences and instruments akin to SNMP, nmap, libpcap, GraphViz and RRDtool
  • Improve filesystem, approach, and community safeguard

This variation contains extra appendixes to get you on top of things on applied sciences equivalent to XML/XPath, LDAP, SNMP, and SQL. With this ebook in hand and Perl on your toolbox, you are able to do extra with less--fewer assets, much less attempt, and much much less hassle.

Show description

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

Similar Computing books

Robot Programming : A Practical Guide to Behavior-Based Robotics

* Teaches the ideas of behavior-based programming via textual content, programming examples, and a special on-line simulator robotic * Explains the way to layout new behaviors through manipulating previous ones and adjusting programming * doesn't imagine reader familiarity with robotics or programming languages * incorporates a part on designing your individual behavior-based process from scratch

Microsoft SQL Server 2012 A Beginners Guide 5/E

Crucial Microsoft SQL Server 2012 abilities Made effortless wake up and working on Microsoft SQL Server 2012 very quickly with support from this completely revised, useful source. jam-packed with real-world examples and hands-on workouts, Microsoft SQL Server 2012: A Beginner's consultant, 5th variation begins through explaining primary relational database procedure thoughts.

Java: The Complete Reference, Ninth Edition

The Definitive Java Programming consultant absolutely up-to-date for Java SE eight, Java: the full Reference, 9th version explains how one can enhance, bring together, debug, and run Java courses. Bestselling programming writer Herb Schildt covers the full Java language, together with its syntax, key phrases, and basic programming ideas, in addition to major parts of the Java API library.

Introduction to Cryptography with Coding Theory (2nd Edition)

With its conversational tone and functional concentration, this article mixes utilized and theoretical facets for a pretty good advent to cryptography and safety, together with the newest major developments within the box. Assumes a minimum heritage. the extent of math sophistication is such as a direction in linear algebra.

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

Show sample text content

Four. learn the database dossier right into a hash of hashes, checking the information as we cross. Generate a header. Write out the ahead mapping (name-to-IP handle) dossier and payment it into RCS. Write out the opposite mapping (IP address-to-name) dossier and fee it into RCS. this is the code and its output: use Rcs; my my my my my my my $datafile $outputfile $target $revtarget $defzone $rcsbin $recordsep = = = = = = = 'database'; "zone. $$"; 'zone. db'; 'rev. db'; '. oog. org'; '/usr/local/bin'; "-=-\n"; # # # # # # our host database our transitority output dossier our aim output our objective output for the opposite mapping the default sector being created situation of our RCS binaries # get modern-day date within the shape YYYYMMDD my @localtime = localtime; my $today = sprintf( "%04d%02d%02d", $localtime[5] + 1900, $localtime[4] + 1, $localtime[3] ); # get username on both home windows or Unix my $user = area identify provider (DNS) | 159 ( $^O eq 'MSWin32' ) ? $ENV{USERNAME} : ( getpwuid($<) )[6] . ' (' . ( getpwuid($<) )[0] . ')'; # learn within the database dossier open my $DATAFILE, '<', "$datafile" or die "Unable to open datafile:$! \n"; my %addrs; my %entries; { neighborhood $/ = $recordsep; # learn within the database dossier one checklist at a time whereas (<$DATAFILE>) { chomp; # get rid of the list separator # cut up into key1,value1 my @record = break up /:\s*|\n/; my $record = {}; # create a connection with empty hash %{$record} = @record; # populate that hash with @record # payment for undesirable hostname if ( $record->{name} =~ /[^-. a-zA-Z0-9]/ ) { warn '!!!! ' . $record->{name} . " has unlawful host identify characters, skipping... \n"; subsequent; } # cost for undesirable aliases if ( $record->{aliases} =~ /[^-. a-zA-Z0-9\s]/ ) { warn '!!!! ' . $record->{name} . " has unlawful alias identify characters, skipping... \n"; subsequent; } # money for lacking deal with if ( ! $record->{address} ) { warn '!!!! ' . $record->{name} . " doesn't have an IP tackle, skipping... \n"; subsequent; } # cost for replica tackle if ( outlined $addrs{ $record->{address} } ) { warn '!!!! reproduction IP addr:' . $record->{name} . ' & ' . $addrs{ $record->{address} } . ", skipping... \n"; subsequent; } else { $addrs{ $record->{address} } = $record->{name}; } a hundred and sixty | bankruptcy 5: TCP/IP identify and Configuration providers } $entries{ $record->{name} } = $record; } shut $DATAFILE; # upload this to a hash of hashes my $header = GenerateHeader(); # create the ahead mapping dossier open my $OUTPUT, '>', "$outputfile" or die "Unable to jot down to $outputfile:$! \n"; print $OUTPUT $header; foreach my $entry ( style byaddress keys %entries ) { print $OUTPUT "; Owned by means of ", $entries{$entry}->{owner}, ' (', $entries{$entry}->{department}, "): ", $entries{$entry}->{building}, '/', $entries{$entry}->{room}, "\n"; # print A list printf $OUTPUT "%-20s\tIN A $entries{$entry}->{address}; } %s\n", $entries{$entry}->{name}, # print any CNAMES (aliases) if ( outlined $entries{$entry}->{aliases} ) { foreach my $alias ( cut up( ' ', $entries{$entry}->{aliases} ) ) { printf $OUTPUT "%-20s\tIN CNAME %s\n", $alias, $entries{$entry}->{name}; } } print $OUTPUT "\n"; shut $OUTPUT; Rcs->bindir($rcsbin); my $rcsobj = Rcs->new; $rcsobj->file($target); $rcsobj->co('-l'); rename( $outputfile, $target ) or die "Unable to rename $outputfile to $target:$!

Download PDF sample

Rated 4.92 of 5 – based on 10 votes