Koozali.org: home of the SME Server
Legacy Forums => General Discussion (Legacy) => Topic started by: Brave Dave on March 23, 2005, 08:49:09 PM
-
With the Stats that run from the cron job with these contribs from http://sme.swerts-knudsen.dk/
They only report part of the day, I'm guessing that this changes with the timezone, but I only see 15-23
I have ensured it is the latest version and both have the previously mentioned
$opt{'timezone'} = date +%Z;
Date_Init("TZ=$opt{'timezone'}");
to work around I change part of the parse_arg subroutine to be as follows and I get the desired results (at least I do in the spamfilter one, haven't tried the av one)
#if(!$start && !$end) {
$end = time;
$start = $end - $secsinday;
return ($start, $end);
#}
My TimeZone is reported as EST
Is there a better answer ?
-
Funny you mentioned this.... I had asked Jesper about the same thing the other day, and he confirmed that EST is worldwide US east coast time zone. He suggested I tried this from a command line - as root:
# export TZ=GMT+11
Googling for export TZ= will tell you the whole story. You can make this environment permanent by inserting the command in /etc/profile . I have tested the effect by running the script manually (/usr/bin/spamfilter-stats.pl) and spams events are now reported over 24 hours, not 6 as previously the case. Done this today, so midnight will tell if all is OK... Will let you know. chris.
-
Ok thanks for the reply
I'm going to change the date line in the scrip to read
$opt{'timezone'} = date +%z;
date +%z returns
TimeZone = +1000
rather than the EST denotion, my Fedora servers also return EST - I'm guessing it may also do that on the east coast of Africa
will await midnight for the result
-
I have drawn a blank at midnight. Same as before because inserting the command "export TZ=GMT+11" in /etc/profile does not affect system time, it only changes time zone for bash, correct? Back to the drawing board I am efraid...
I'm going to change the date line in the scrip to read
$opt{'timezone'} = date +%z;
date +%z returns
TimeZone = +1000
Where is this script located?
regards
chris
-
/usr/bin/spamfilter-stats.pl
/usr/bin/antivirus-stats.pl
line 36/37
$opt{'timezone'} = date +%z;
-
/usr/bin/spamfilter-stats.pl
/usr/bin/antivirus-stats.pl
line 36/37
$opt{'timezone'} = date +%z;
Thanks David. Done it and its looking much better, I think you done it! Removed all changes in etc/profile [back to EST = +11 in NSW, +10 for you in QLD] and just executed spamfilter-stats.pl
Results:
Period Beginning : Thu 24 Mar 2005 05:32:34 PM EST
Period Ending : Fri 25 Mar 2005 05:32:34 PM EST
Reporting Period : 24.00 hrs
And we now have spam counts for each hour of the day, as applicable. Let see what happen at midhnight when cron do it on its own.. cheers. chris.
PS: foced a cron job at 19:25 this arvo, and got:
Period Beginning : Thu Mar 24 19:25:01 2005
Period Ending : Fri Mar 25 19:25:01 2005
Reporting Period : 24.00 hrs
fixed I think.
-
Yes: Fixed here too