Current time: 11-26-2024, 02:03 PM Hello There, Guest! (LoginRegister)


Post Reply 
Readout domainslist for webalizer
Author Message
topmusic Offline
Newbie
*

Posts: 5
Joined: Jul 2007
Reputation: 0
Post: #6
RE: Readout domainslist for webalizer
(04-30-2009 01:16 AM)rbtux Wrote:  when all customers have all services in ispcp you could read the file /etc/postfix/ispcp/domains... as simple approach...

That domains file differs from the 1 that is created by the script.

here are the files that are be used to readout the domainlist in the vhcs2 system.

webalizer.cron
Code:
#!/bin/bash
/var/www/vhcs2/engine/vhcs2-get-domain.pl
for domain in $(cat /etc/webalizer/domains)
do
webalizer /var/www/virtual/$domain/logs/$domain-access.log -o /var/www/virtual/$domain/htdocs/webstats/
done

and the vhcs2-get-domain.pl
Code:
#!/usr/bin/perl -w
require '/var/www/ispcp/engine/ispcp_common_code.pl';
use strict;
use warnings;
&return_all_domains;
sub return_all_domains {
  #initializing vars
  my $sql;
  my ($rs, $rdata) = (undef, undef);
  $sql = "select domain_name from domain";

  ($rs, $rdata) = doSQL($sql);

  my $dmn_count = @$rdata;

  # open the file to write all domains in
  open(FILE, '>/etc/webalizer/domains') or die("impossible Access /etc/webalizer/domains");

  if ($dmn_count > 0) {
    foreach (@$rdata) {
      my $row = $_;
      print FILE @$row[0]."\n";
      #it is necessary to add an anti slash before last "N" of the preceding line.

    }
  }
  close FILE;
}

hope you have enough or else i put the files online.
i already changed the lines containing vhcs to ispcp, that is the same for the file 'ispcp_common_code.pl'
the original you can get at http://www.top-music.org/ispcp/files/vhc...n_code.zip

kind regards.
(This post was last modified: 05-02-2009 10:10 PM by topmusic.)
05-02-2009 10:00 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Readout domainslist for webalizer - topmusic - 05-02-2009 10:00 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)