#!/usr/bin/perl -w use strict; use Socket; use Config; use CGI::Carp qw(warningsToBrowser fatalsToBrowser); use CGI; my $cgi = CGI->new(); print $cgi->header(); warningsToBrowser(1); # dies ist ganz wichtig! my $eval_in_died; my $mod_dbi=0; my $mod_ff=0; my $mod_fb=0; my $mod_gz=0; my $mod_ftp=0; my $mod_mime=0; my $dbi_driver; my $dbi_mysql_exists=0; my $get_options=0; my $ok=''; my $err=''; my $zlib_version='unknown'; print "MySQLDumper Perltest\n"; print ''; print "

Testing needed Perl-Moduls in order to run the Perl script crondump.pl

\n"; print "

Necessary Modules for crondump.pl

"; print "testing DBI ...\n"; eval { $eval_in_died = 1; require DBI; }; if(!$@){ $mod_dbi = 1; import DBI; } if($mod_dbi!=1){ print $err."Couldn't findDBI!
crondump.pl can't establih a connection to the MySQL database!
\n"; } else { print $ok."Found modul DBI. OK.
\n"; my @available_drivers = DBI->available_drivers('quiet'); foreach $dbi_driver (@available_drivers) { print "
Found modul DBI::$dbi_driver\n"; if ( $dbi_driver eq 'mysql' ) { $dbi_mysql_exists=1; } ; } if ($dbi_mysql_exists !=1 ) { print $err."Critical error: modul DBI::mysql not found! crondump.pl can't establish a connection to the MySQL-Databse if this modul isn't installed! Please install DBI::mysql!"; } else { print "
".$ok."Found modul DBI::mysql. OK. crondump.pl can connect to MySQL-Database."; } } print "

testing File::Find ...\n"; eval { $eval_in_died = 1; require File::Find; }; if(!$@){ $mod_ff = 1; import File::Find; } if($mod_ff!=1){ print $err."Critical error: modul File::Find not found! Please install it
\n"; } else { print $ok."Found modul File::Find. OK.
\n"; } print "testing File::Basename ...\n"; eval { $eval_in_died = 1; require File::Basename; }; if(!$@){ $mod_fb = 1; import File::Basename; } if($mod_fb!=1){ print $err."Critical error: modul File::Basename not found! Please install it!
\n"; } else { print $ok."Found modul File::Basename. OK.
\n"; } print "testing Getop...\n"; eval { $eval_in_died = 1; require Getopt::Long; }; if(!$@){ $get_options = 1; import Getopt::Long; } if($get_options!=1){ print $err."Modul Getopt not found! You should install it if you want to set configfile via shell.
\n"; } else { print $ok."Found modul Getopt. OK. crondump.pl can read configfile-parameter from shell.
\n"; } print "

Configurable functions for crondump.pl (these moduls are only needed when explained option is turned on):

"; print "testing Compress::Zlib (needed for dumping data into a crompessed *.gz-file)...
\n"; eval { $eval_in_died = 1; require Compress::Zlib; }; if(!$@){ $zlib_version=qq[ver $Compress::Zlib::VERSION]; $mod_gz = 1; import Compress::Zlib; } if($mod_gz!=1){ print "Error: modul Compress::Zlib not found! crondump.pl can't write compressed files. Falling back to uncrompressed files (files are 10 times bigger).
\n"; } else { print $ok."Found modul Compress::Zlib ".$zlib_version.". OK. crondump.pl can write compressed backups.
\n"; } print "
testing Net::FTP (needed if you want to transfer backups to another server)...
\n"; eval { $eval_in_died = 1; require Net::FTP; }; if(!$@){ $mod_ftp = 1; import Net::FTP; } if($mod_ftp!=1){ print $err."Error: modul Net::FTP not found! crondump.pl can't transfer data via FTP.
\n"; } else { print $ok."Found modul Net::FTP. OK - crondump.pl can send backups via FTP.
\n"; } print "
testing MIME::Lite (needed if you want to send backups via email)...
\n"; eval { $eval_in_died = 1; require MIME::Lite; }; if(!$@){ $mod_mime = 1; import MIME::Lite; } if($mod_mime!=1){ print $err."Error: modul MIME::Lite not found!
crondump.pl can't send emails! Option will automatically be deactivated. Install Mime::Lite in order to send emails!\n"; } else { print $ok."Found modul MIME::Lite. OK. crondump.pl can send emails.
\n"; } print "



\n";