CVS: ispman/bin ispman.listRadiusProfiles,1.1,1.2 ispman.addDomainService,1.2,1.3 ispman.addMailGroup,1.2,1.3 ispman.loganalyzer,1.7,1.8 ispman.makelogs,1.21,1.22 ispman.ispmail,1.2,NONE ispman.listMailboxACL,1.1,NONE ispman.mail,1.2,NONE ispman.sitereport,1.1,NONE ispman.soap.server,1.2,NONE ispmanc,1.1,NONE ispmanc.get_domains,1.1,NONE ispmand,1.1,NONE ldifcompare,1.1,NONE senduseraliases,1.4,NONE showdomains.soap.pl,1.1,NONE

Joerg Delker <[email protected]>
Newsgroups gmane.comp.isp.ispman.cvs
Message-ID <[email protected]>
Update of /cvsroot/ispman/ispman/bin
In directory sc8-pr-cvs1:/tmp/cvs-serv23200/bin

Modified Files:
	ispman.addDomainService ispman.addMailGroup ispman.loganalyzer 
	ispman.makelogs 
Added Files:
	ispman.listRadiusProfiles 
Removed Files:
	ispman.ispmail ispman.listMailboxACL ispman.mail 
	ispman.sitereport ispman.soap.server ispmanc 
	ispmanc.get_domains ispmand ldifcompare senduseraliases 
	showdomains.soap.pl 
Log Message:
rollback of HEAD to REL_1_0 versions
former HEAD development will continue in "experimental-branch" and merged back here
(more info on ispman-developer maillist and upcoming README.cvs in HEAD)



Index: ispman.addDomainService
===================================================================
RCS file: /cvsroot/ispman/ispman/bin/ispman.addDomainService,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** ispman.addDomainService	10 May 2002 12:55:41 -0000	1.2
--- ispman.addDomainService	4 Jan 2004 18:56:13 -0000	1.3
***************
*** 1,4 ****
  #!/usr/bin/perl
! BEGIN {
     use FindBin; unshift @INC, ($FindBin::Bin , "$FindBin::Bin/../lib", "$FindBin::Bin/../conf");
     print "Name of the service: ";
--- 1,4 ----
  #!/usr/bin/perl
! BEGIN{
     use FindBin; unshift @INC, ($FindBin::Bin , "$FindBin::Bin/../lib", "$FindBin::Bin/../conf");
     print "Name of the service: ";

Index: ispman.addMailGroup
===================================================================
RCS file: /cvsroot/ispman/ispman/bin/ispman.addMailGroup,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** ispman.addMailGroup	2 Jan 2004 14:33:59 -0000	1.2
--- ispman.addMailGroup	4 Jan 2004 18:56:13 -0000	1.3
***************
*** 12,17 ****
        print " and all mails will be forwarded to the email address postmaster\@domain.tld\n\n";
        print "The forwarding address does not need to be in the same domain as the mailGroup\n";
-       print "If you want more than one adress in the mailgroup, separate the adresses with two spaces\n"; 
-       print "Like this: -f 'adress1  adress2' \n";
        exit;
     }
--- 12,15 ----

Index: ispman.loganalyzer
===================================================================
RCS file: /cvsroot/ispman/ispman/bin/ispman.loganalyzer,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** ispman.loganalyzer	16 Jul 2003 17:25:39 -0000	1.7
--- ispman.loganalyzer	4 Jan 2004 18:56:13 -0000	1.8
***************
*** 33,41 ****
  	$sitename=$dir;
  	@sitename=split("/", $dir);
! 	if ($sitename[$#sitename] eq "stats") {
! 		$sitename=join ('.', ($sitename[$#sitename-1], $sitename[$#sitename-3]));
! 	} else {
! 		$sitename=join ('.', ($sitename[$#sitename], $sitename[$#sitename-1]));
! 	}
   
  	chdir "$dir/raw" or die "Cant chdir";
--- 33,37 ----
  	$sitename=$dir;
  	@sitename=split("/", $dir);
! 	$sitename=join ('.', ($sitename[$#sitename], $sitename[$#sitename-1]));
   
  	chdir "$dir/raw" or die "Cant chdir";
***************
*** 62,66 ****
  
  	for $log(@logs){
! 		$cmd="$webalizer -q -p -n $sitename -o $dir/report -t 'Log Report for'  $dir/raw/$log\n";
                  if ($opts{'n'}) {
                     print $cmd;
--- 58,62 ----
  
  	for $log(@logs){
! 		$cmd="$webalizer -p -n $sitename  -o $dir/report -t 'Log Report'  $dir/raw/$log\n";
                  if ($opts{'n'}) {
                     print $cmd;

Index: ispman.makelogs
===================================================================
RCS file: /cvsroot/ispman/ispman/bin/ispman.makelogs,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -r1.21 -r1.22
*** ispman.makelogs	8 Oct 2003 05:00:28 -0000	1.21
--- ispman.makelogs	4 Jan 2004 18:56:13 -0000	1.22
***************
*** 17,21 ****
        $webalizer
        $rawDirectory
! 	);
  }
  
--- 17,22 ----
        $webalizer
        $rawDirectory
!       $logsDir
!    );
  }
  
***************
*** 23,26 ****
--- 24,28 ----
  use File::Copy;
  use File::Path;
+ use lib qw(%%installDir%%/lib);
  
  use ISPMan;
***************
*** 28,34 ****
--- 30,38 ----
  
  
+ $logsDir=$ispman->getConf("apacheLogsDirectory");
  $webalizer=$ispman->getConf("apacheWebalizerPath");
  my $apacheGracefulCommand=$ispman->getConf("apacheGracefulCommand");
  my $apacheGracefulTime=$ispman->getConf("apacheGracefulTime");
+ $vhostsHashFile=join '.', ($ispman->getConf("apacheVhostsFile"), "hash");
  
  # Basic Password security
***************
*** 61,97 ****
  }
  
  unless (-e $webalizer){
      warn  "Webalizer command does not exists\nI will split the files but no reports will be generated.";
  }
  
! if ($ispman->getConf("ispmanVhostsStyle") =~ /dir/m) {
!   print "Using one hash file per domain\n";
!   my ($domain, $domains);
! 
!   $domains = $ispman->makeDomainHash($ispman->getDomains());
! 
!   $vhosts="";
!   foreach $domain (keys %$domains) {
!     my $domainInfo = $ispman->getDomainInfo($domain);
!     unless ($domainInfo->{'ispmanDomainType'} eq "replica") {
!       $vhostsHashFile = join("/", $ispman->getConf("apacheVhostsFile"), "hash", $domain) . ".hash";
!       if (-e $vhostsHashFile) {
!         print "Loading $vhostsHashFile...\n";
!         require $vhostsHashFile;
!         $vhosts .= $VAR1;
!       } else {
!         warn "No file found for $domain\n";
!       }
!     }
!   }
! } else {
!   print "Using one hash file for all domains\n";
!   $vhostsHashFile=join '.', ($ispman->getConf("apacheVhostsFile"), "hash");
!   if (-e $vhostsHashFile) {
      require $vhostsHashFile;
      $vhosts=$VAR1;
!   } else {
      die "No VhostsHash file found $vhostsHashFile\n";
-   }
  }
  
--- 65,81 ----
  }
  
+ unless (-e $logsDir){
+     die "Logs directory $logsDir does not exists\n";
+ }
+ 
  unless (-e $webalizer){
      warn  "Webalizer command does not exists\nI will split the files but no reports will be generated.";
  }
  
! if (-e $vhostsHashFile) {
      require $vhostsHashFile;
      $vhosts=$VAR1;
! } else {
      die "No VhostsHash file found $vhostsHashFile\n";
  }
  
***************
*** 105,122 ****
  
  
! print "\nStart by moving current log files to new filename to avoiding writing\n";
! print "to them while we are working with em.\n";
  processAllServers("moveLogsForClose");
! print "\nNow lets restart the webserver to open new logfiles. Open connections will be\n";
! print "logged to temporary logfiles for the next ". $apacheGracefulTime/60 ." minutes.\n  ";
  system($apacheGracefulCommand);
! print "Now lets hold the script for ". $apacheGracefulTime/60 ." minutes to give the webserver a chance \n";
! print "to close open connections. Please stand by...";
  sleep($apacheGracefulTime);
  print "OK. It\'s time to work!\n";
  processAllServers("moveLogsForParse");
! print "\nNow we generate the reports\n";
  processAllServers("generateReports");
- print "\nDone!\n\n";
  
  
--- 89,104 ----
  
  
! print "Moving actual log files to new filename for closing open connections\n";
  processAllServers("moveLogsForClose");
! print "Now we tell the Apache to start to write to new logfiles\n";
! print "Open connections will be logged to temporary logfiles for the next Minutes\n";
  system($apacheGracefulCommand);
! print "Now lets hold the script for $apacheGracefulTime seconds to give apache a chance \n";
! print "to close open connections. Please stand by...\n";
  sleep($apacheGracefulTime);
  print "OK. It\'s time to work!\n";
  processAllServers("moveLogsForParse");
! print "Now we generate the reports\n";
  processAllServers("generateReports");
  
  
***************
*** 128,134 ****
  		for $vhost   (keys %$domainVhosts) {
  			$servername=$domainVhosts->{$vhost}{'servername'};
!                         if (lc($domainVhosts->{$vhost}{'ispmanVhostStats'}) eq "enable" || $domainVhosts->{$vhost}{'logdir'} eq "") {
! 			  &{$whatCanIDoForYou};
!                         }
  		}
  	}
--- 110,114 ----
  		for $vhost   (keys %$domainVhosts) {
  			$servername=$domainVhosts->{$vhost}{'servername'};
! 			&{$whatCanIDoForYou};
  		}
  	}
***************
*** 136,158 ****
  
  sub moveLogsForClose{
!         my $logdir = $domainVhosts->{$vhost}{'logdir'};
! 
!         ### Here for upgraders
!         if ($logdir eq "") {
!           $logdir = $ispman->getConf("apacheLogsDirectory");
!           $logdir = join "/", ($logdir, "vhosts");
!         }
! 
!         ### Check for relative paths
!         if ($logdir !~ /^\//) {
!           $logdir = join "/", ($domainVhosts->{$vhost}{'serverroot'}, "vhosts", $logdir);
!         }  
! 
! 	my $logfile=join "/", ($logdir, $servername.".access");
! 	my $closelogfile=join "/", ($logdir, $servername.".access.close");
! 	print "  Working on logs for $servername...";
  	if (-e $logfile) {
! 		print " (found)...";
! 		print " (moved)\n";
  		move ($logfile, $closelogfile);
  	}
--- 116,126 ----
  
  sub moveLogsForClose{
! 	my $logfile="$logsDir/vhosts/$servername\.access";
! 	my $closelogfile="$logsDir/vhosts/$servername\.access\.close";
! 	print "LogFile: $logfile: $logfile\n";
  	if (-e $logfile) {
! 		print "Working on $servername\n";
! 		print "Log file found\n";
! 		print "Moving $logfile to $closelogfile now\n";
  		move ($logfile, $closelogfile);
  	}
***************
*** 161,193 ****
  
  sub moveLogsForParse{
!         my $statdir = $domainVhosts->{$vhost}{'statdir'};
!         my $logdir = $domainVhosts->{$vhost}{'logdir'};
! 
!         ### Here for upgraders
!         if ($logdir eq "") {
!           $logdir = $ispman->getConf("apacheLogsDirectory");
!           $logdir = join "/", ($logdir, "vhosts");         
!         }
!         if ($statdir eq "") {
!           $statdir = $ispman->getConf("apacheLogsDirectory");
!           $statdir = join "/", ($statdir, "domains", $domain, $vhost);
!         }
! 
!         ### Check for relative paths
!         if ($logdir !~ /^\//) { 
!           $logdir = join "/", ($domainVhosts->{$vhost}{'serverroot'}, "vhosts", 
! $logdir);
!         }
!         if ($statdir !~ /^\//) {
!           $statdir = join "/", ($domainVhosts->{$vhost}{'serverroot'}, "vhosts", $statdir);
!         }
! 
! 	my $logfile=$logdir."/".$servername.".access.close";
! 	my $rawfile=$servername.".access";
! 	print "  Logfile for $servername...";
  	if (-e $logfile) {
! 		print "(found)\n";
! 		my $rawDirectory=$statdir."/raw";
! 		my $reportDirectory=$statdir."/report";
  		mkpath ($rawDirectory)  unless (-d $rawDirectory);
  		mkpath ($reportDirectory) unless (-d $reportDirectory);
--- 129,140 ----
  
  sub moveLogsForParse{
! 	print "Working on $servername\n";
! 	my $logfile="$logsDir/vhosts/$servername\.access\.close";
! 	my $rawfile="$servername\.access";
! 	print "Logfile: $logfile\n";
  	if (-e $logfile) {
! 		print "Log file found\n";
! 		my $rawDirectory="$logsDir/domains/$domain/$vhost/raw";
! 		my $reportDirectory="$logsDir/domains/$domain/$vhost/report";
  		mkpath ($rawDirectory)  unless (-d $rawDirectory);
  		mkpath ($reportDirectory) unless (-d $reportDirectory);
***************
*** 196,220 ****
  		print "No logfile found. Skipping this one\n";
  	}
  }
  
! sub generateReports {
!         my $statdir = $domainVhosts->{$vhost}{'statdir'};
!         my $logfile, $vhostDirectory, $rawDirectory;
! 
!         ### Here for upgraders      
!         if ($statdir eq "") {
!           $statdir = $ispman->getConf("apacheLogsDirectory");
!           $statdir = join "/", ($statdir, "domains", $domain, $vhost);
!         }
! 
!         ### Check for relative paths
!         if ($statdir !~ /^\//) {
!           $statdir = join "/", ($domainVhosts->{$vhost}{'serverroot'}, "vhosts", $statdir);
!         }
! 
!         $vhostDirectory = $statdir;
! 	$logfile=$vhostDirectory."/raw/".$servername.".access";
  	if (-e $logfile)  {
! 		$rawDirectory="$vhostDirectory/raw";
  		open "FILE", "$logfile" || die "Cant open logFile";
                  $lastDate="";
--- 143,154 ----
  		print "No logfile found. Skipping this one\n";
  	}
+ 	print "\n";
  }
  
! sub generateReports{
! 	my $logfile="$logsDir/domains/$domain/$vhost/raw/$servername\.access";
  	if (-e $logfile)  {
! 		$vhostDirectory="$logsDir/domains/$domain/$vhost";
! 		$rawDirectory="$logsDir/domains/$domain/$vhost/raw";
  		open "FILE", "$logfile" || die "Cant open logFile";
                  $lastDate="";
***************
*** 235,239 ****
  
  	if (-e $webalizer) {
! 		print "  Building report for $servername\n";
  		my $cmd="perl  $FindBin::Bin/ispman.loganalyzer -c $webalizer -d $vhostDirectory";
  		system($cmd);
--- 169,173 ----
  
  	if (-e $webalizer) {
! 		print "Making report for $servername\n";
  		my $cmd="perl  $FindBin::Bin/ispman.loganalyzer -c $webalizer -d $vhostDirectory";
  		system($cmd);

--- ispman.ispmail DELETED ---

--- ispman.listMailboxACL DELETED ---

--- ispman.mail DELETED ---

--- ispman.sitereport DELETED ---

--- ispman.soap.server DELETED ---

--- ispmanc DELETED ---

--- ispmanc.get_domains DELETED ---

--- ispmand DELETED ---

--- ldifcompare DELETED ---

--- senduseraliases DELETED ---

--- showdomains.soap.pl DELETED ---



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.