Mailing List Archive

sa-stats.pl problem
Running SA 2.63, sa-stats.pl, Solaris 9, qmail-1.03, qmail-scanner 1.20,
clamav 0.67

When I run sa-stats.pl I get the following output, and the figures are
way off:

bash-2.05# ./sa-stats.pl
Report Title : SpamAssassin - Spam Statistics
Report Date : %F
Period Beginning : Sat Mar 06 23:04:25 2004
Period Ending : Sun Mar 07 23:04:25 2004

Reporting Period : 24.00 hrs
--------------------------------------------------

Note: 'ham' = 'nonspam'

Total spam detected : 2 ( 14.29%)
Total ham accepted : 12 ( 85.71%)
-------------------
Total emails processed : 14 ( 1/hr)

Average spam threshold : 4.80
Average spam score : 14.70
Average ham score : -3.43

Spam kbytes processed : 8 ( 0 kb/hr)
Ham kbytes processed : 35 ( 1 kb/hr)
Total kbytes processed : 44 ( 2 kb/hr)

Spam analysis time : 12 s ( 1 s/hr)
Ham analysis time : 73 s ( 3 s/hr)
Total analysis time : 86 s ( 4 s/hr)


Statistics by Hour
-------------------------------------
Hour Spam Ham
-------------- -------- --------
%F, 23 1 12
%F, 00 1 0
%F, 01 0 0
%F, 02 0 0
%F, 03 0 0
%F, 04 0 0
%F, 05 0 0
%F, 06 0 0
%F, 07 0 0
%F, 08 0 0
%F, 09 0 0
%F, 10 0 0
%F, 11 0 0
%F, 12 0 0
%F, 13 0 0
%F, 14 0 0
%F, 15 0 0
%F, 16 0 0
%F, 17 0 0
%F, 18 0 0
%F, 19 0 0
%F, 20 0 0
%F, 21 0 0
%F, 22 0 0
%F, 23 0 0


Done. Report generated in 78 sec.
Re: sa-stats.pl problem [ In reply to ]
----- Original Message -----
From: "Darren Honeyball [ML]" <mlist@spod.net>
To: <spamassassin-users@incubator.apache.org>
Sent: Saturday, March 06, 2004 7:10 PM
Subject: sa-stats.pl problem


> Running SA 2.63, sa-stats.pl, Solaris 9, qmail-1.03, qmail-scanner 1.20,
> clamav 0.67
>
> When I run sa-stats.pl I get the following output, and the figures are
> way off:
>
> bash-2.05# ./sa-stats.pl
> Report Title : SpamAssassin - Spam Statistics
> Report Date : %F
> Period Beginning : Sat Mar 06 23:04:25 2004
> Period Ending : Sun Mar 07 23:04:25 2004

It looks like the period is into the future?
Re: sa-stats.pl problem [ In reply to ]
On Sat, 6 Mar 2004 21:08:06 -0500 "John Fleming" <john@wa9als.com> wrote:
> From: "Darren Honeyball [ML]" <mlist@spod.net>
> > Running SA 2.63, sa-stats.pl, Solaris 9, qmail-1.03, qmail-scanner 1.20,
> > clamav 0.67
> >
> > When I run sa-stats.pl I get the following output, and the figures are
> > way off:
> >
> > bash-2.05# ./sa-stats.pl
> > Report Title : SpamAssassin - Spam Statistics
> > Report Date : %F
> > Period Beginning : Sat Mar 06 23:04:25 2004
> > Period Ending : Sun Mar 07 23:04:25 2004
>
> It looks like the period is into the future?

Not if you're on GMT.

The original problem looks like an issue with Solaris' strftime()
function (or presuming that what's good enough for linux is good enough
for Solaris.)

Try using my version of sa-stats.pl at
http://www.cynistar.net/~apthorpe/code/sa-contrib/sa-stats.pl

It has some additional code that's not in the SA distribution and
doesn't use "%F" with strftime(), possibly to solve this very problem.

hth,

-- Bob
Re: sa-stats.pl problem [ In reply to ]
On Sat, Mar 06, 2004 at 08:48:41PM -0600, Bob Apthorpe wrote:
> The original problem looks like an issue with Solaris' strftime()
> function (or presuming that what's good enough for linux is good enough
> for Solaris.)
>
> Try using my version of sa-stats.pl at
> http://www.cynistar.net/~apthorpe/code/sa-contrib/sa-stats.pl
>
> It has some additional code that's not in the SA distribution and
> doesn't use "%F" with strftime(), possibly to solve this very problem.

BTW, patches are welcome...

--
Duncan Findlay
Re: sa-stats.pl problem [ In reply to ]
On Sat, 6 Mar 2004 22:10:54 -0500 Duncan Findlay <duncf@debian.org> wrote:

> On Sat, Mar 06, 2004 at 08:48:41PM -0600, Bob Apthorpe wrote:
> > The original problem looks like an issue with Solaris' strftime()
> > function (or presuming that what's good enough for linux is good enough
> > for Solaris.)
> >
> > Try using my version of sa-stats.pl at
> > http://www.cynistar.net/~apthorpe/code/sa-contrib/sa-stats.pl
> >
> > It has some additional code that's not in the SA distribution and
> > doesn't use "%F" with strftime(), possibly to solve this very problem.
>
> BTW, patches are welcome...

I thought I submitted one (I'm not whining, honest...)

Ha! Found it:

http://bugzilla.spamassassin.org/show_bug.cgi?id=2988

I may well be misunderstanding the patch submission process which could
explain why this has slipped through the cracks.

-- Bob
Re: sa-stats.pl problem [ In reply to ]
Bob Apthorpe wrote:

> On Sat, 6 Mar 2004 21:08:06 -0500 "John Fleming" <john@wa9als.com> wrote:
>
>>From: "Darren Honeyball [ML]" <mlist@spod.net>
>>
>>>Running SA 2.63, sa-stats.pl, Solaris 9, qmail-1.03, qmail-scanner 1.20,
>>>clamav 0.67
>>>
>>>When I run sa-stats.pl I get the following output, and the figures are
>>>way off:
>>>
>>>bash-2.05# ./sa-stats.pl
>>>Report Title : SpamAssassin - Spam Statistics
>>>Report Date : %F
>>>Period Beginning : Sat Mar 06 23:04:25 2004
>>>Period Ending : Sun Mar 07 23:04:25 2004
>>
>>It looks like the period is into the future?
>
>
> Not if you're on GMT.
>
> The original problem looks like an issue with Solaris' strftime()
> function (or presuming that what's good enough for linux is good enough
> for Solaris.)
>
> Try using my version of sa-stats.pl at
> http://www.cynistar.net/~apthorpe/code/sa-contrib/sa-stats.pl
>
> It has some additional code that's not in the SA distribution and
> doesn't use "%F" with strftime(), possibly to solve this very problem.
>
> hth,
>
> -- Bob

Works a treat - thanks.
sa-stats.pl problem [ In reply to ]
I seem to be having a problem when running the script. I am getting the
following error:

Error in option spec: "top|T:25"
Error in option spec: "SCALAR(0x851337c)"

Any idea what is causing that? I made sure I installed both DateManip and
Parse-Syslog.

james
Re: sa-stats.pl problem [ In reply to ]
On Tue, 9 Mar 2004 08:57:47 -0600 "James Nelson" <james@kcnet.com> wrote:

>
> I seem to be having a problem when running the script. I am getting the
> following error:
>
> Error in option spec: "top|T:25"
> Error in option spec: "SCALAR(0x851337c)"
>
> Any idea what is causing that? I made sure I installed both DateManip and
> Parse-Syslog.

What do you get when you run:

perl -MGetopt::Long -e 'print $Getopt::Long::VERSION, "\n";'

?

You might need to upgrade Getopt::Long.

-- Bob
Re: sa-stats.pl problem [ In reply to ]
James Nelson wrote:

> Error in option spec: "top|T:25"
> Error in option spec: "SCALAR(0x851337c)"
>
> Any idea what is causing that? I made sure I installed both DateManip and
> Parse-Syslog.

Got the same error on RH7.3 box. Edit sa-stats.pl and comment out the
line that contains "top|T:25". Then it will work but you loose the
topusers stats.

So you may simply remote the ":25" string from the same line and live
with no 25-topusers default.

An upgrade would help, but not on a production ENV! :-)

Greets,
Paolo
Re: sa-stats.pl problem [ In reply to ]
On Tue, Mar 09, 2004 at 08:57:47AM -0600, James Nelson wrote:
> Any idea what is causing that? I made sure I installed both DateManip and
> Parse-Syslog.

I don't have an answer, but related questions: Which package
contains DateManip on a Debian system?

Regards
Johann
--
Johann Spies Telefoon: 021-808 4036
Informasietegnologie, Universiteit van Stellenbosch

"What good is it, my brothers, if a man claims to have
faith, but has no deeds? Can such faith save him?
Suppose a brother or sister is without clothes and
daily food. If one of you says to him, "Go, I wish
you well; keep warm and well fed," but does nothing
about his physical needs, what good is it? In the same
way, faith by itself, if it is not accompanied by
actions, is dead." James 2:14-17
Re: sa-stats.pl problem [ In reply to ]
Hi.
Is this?

On Wed, 10 Mar 2004 08:09:36 +0200
Subject: Re: sa-stats.pl problem
Johann Spies <jspies@sun.ac.za> wrote:

> On Tue, Mar 09, 2004 at 08:57:47AM -0600, James Nelson wrote:
> > Any idea what is causing that? I made sure I installed both DateManip and
> > Parse-Syslog.
>
> I don't have an answer, but related questions: Which package
> contains DateManip on a Debian system?

$ apt-cache search | grep perl | grep -i manip
libarchive-tar-perl - Archive::Tar - manipulate tar files in perl
libarchive-zip-perl - Module for manipulation of ZIP archives
libclass-date-perl - Class::Date - easy date and time manipulation for perl
[snip]
libtime-modules-perl - Various Perl modules for time/date manipulation <<-- !!
liburi-perl - Manipulates and accesses URI strings


http://packages.debian.org/stable/interpreters/libdate-manip-perl
http://packages.debian.org/cgi-bin/search_contents.pl?searchmode=filelist&word=libdate-manip-perl&version=unstable&arch=all



--
Musashino-shi, Tokyo, Japan
K12LTSP in Japanese ; http://open-mitch.dyndns.org/k12ltsp/
Re: sa-stats.pl problem [ In reply to ]
On Wed, Mar 10, 2004 at 08:09:36AM +0200, Johann Spies wrote:
> On Tue, Mar 09, 2004 at 08:57:47AM -0600, James Nelson wrote:
> > Any idea what is causing that? I made sure I installed both DateManip and
> > Parse-Syslog.
>
> I don't have an answer, but related questions: Which package
> contains DateManip on a Debian system?

Doesn't seem to be there, not even on backports.org or apt-get.org.
Unfortunately, apart from alien, I don't know of an easy way to build
native .debs from a CPAN .tar.gz, though there are at least two to
build RPMs. Enlightenment would be welcome here too - perhaps off-list
since it's way OT !

Nick
Re: sa-stats.pl problem [ In reply to ]
On Wed, 10 Mar 2004 11:20:55 +0000 Nick Leverton <nj@leverton.org> wrote:

> On Wed, Mar 10, 2004 at 08:09:36AM +0200, Johann Spies wrote:
> > On Tue, Mar 09, 2004 at 08:57:47AM -0600, James Nelson wrote:
> > > Any idea what is causing that? I made sure I installed both DateManip and
> > > Parse-Syslog.
> >
> > I don't have an answer, but related questions: Which package
> > contains DateManip on a Debian system?
>
> Doesn't seem to be there, not even on backports.org or apt-get.org.
> Unfortunately, apart from alien, I don't know of an easy way to build
> native .debs from a CPAN .tar.gz, though there are at least two to
> build RPMs. Enlightenment would be welcome here too - perhaps off-list
> since it's way OT !

FWIW, Date::Manip is pure perl so I imagine building a .deb shouldn't be
too difficult. I haven't used a Debian system in over 2 years[1] so I
can't help with packaging (sorry.)

-- Bob

[1] The package management system hurt my brain, otherwise the
distribution seemed fairly sane. I suppose I should give it another try.
Re: sa-stats.pl problem [ In reply to ]
Nick Leverton wrote:
> Unfortunately, apart from alien, I don't know of an easy way to build
> native .debs from a CPAN .tar.gz, though there are at least two to
> build RPMs. Enlightenment would be welcome here too - perhaps
> off-list since it's way OT !

dh-make-perl

I had to do this to be able to copy the Bayes db files from a current
RedHat install to a new Debian server. Unfortunately, the Debian
packaging of the "core" Perl modules meant that I had to force dpkg to
overwrite files relating to DB_File. :(

-kgd
--
"Sendmail administration is not black magic. There are legitimate
technical reasons why it requires the sacrificing of a live chicken."
- Unknown
Re: sa-stats.pl problem [ In reply to ]
On Wed, 2004-03-10 at 11:20, Nick Leverton wrote:
> On Wed, Mar 10, 2004 at 08:09:36AM +0200, Johann Spies wrote:
[...]
> > I don't have an answer, but related questions: Which package
> > contains DateManip on a Debian system?
>
> Doesn't seem to be there, not even on backports.org or apt-get.org.

Erm... :-) Why bother with back-ports, given that there's an
implementation of Date::Manip as part of woody?

<URL:http://packages.debian.org/stable/interpreters/libdate-manip-perl>

(apt-cache search --names-only 'lib.*date.*manip.*-perl')

hth

Adam
Re: sa-stats.pl problem [ In reply to ]
On Wed, Mar 10, 2004 at 07:51:53PM +0000, Adam D. Barratt wrote:
> On Wed, 2004-03-10 at 11:20, Nick Leverton wrote:
> > Doesn't seem to be there, not even on backports.org or apt-get.org.
>
> (apt-cache search --names-only 'lib.*date.*manip.*-perl')

Thanks to everyone who enlightened me gently, I _am_ actually waiting
for new glasses (but can't blame them in this case :-)).

Nick