{
    use esmith::ConfigDB;
    use esmith::ConfigDB;

        my $dbh = esmith::ConfigDB->open() || die "Unable to open configuration dbase.";
        my %sa_conf = $dbh->get('dansguardian')->props;

        while (my ($parameter,$value) = each(%sa_conf)) {
          if ($parameter eq 'webstats') {
           $enabled = $value;
          }
        }

        $OUT = "";
        if (uc($enabled) eq 'YES') {

         my $random_hour = 5+int(rand(50));
         $OUT .= "# Hourly Web Filter stats (random minute)\n";
         $OUT .= $random_hour . " * * * * root /usr/local/dansguardian-stats/dansguardian-stats.pl -duration=hour -log -central -crontab\n";
         $OUT .= "# The last 24 hour Web Filter stats (random minute)\n";
         $OUT .= $random_hour . " * * * * root /usr/local/dansguardian-stats/dansguardian-stats.pl -duration=day -log -crontab\n";
        }

}

