Mailing List Archive

sa-stats help?
Where is any info about any required setup prior to running sa-stats? I
tried it and got the following output:

[root@wa9als john]# perl sa-stats.pl
Use of uninitialized value in division (/) at sa-stats.pl line 271, <GEN0>
line 28840.
Use of uninitialized value in division (/) at sa-stats.pl line 271, <GEN0>
line 28840.
Use of uninitialized value in division (/) at sa-stats.pl line 274, <GEN0>
line 28840.
Use of uninitialized value in division (/) at sa-stats.pl line 274, <GEN0>
line 28840.
Use of uninitialized value in division (/) at sa-stats.pl line 277, <GEN0>
line 28840.
Use of uninitialized value in division (/) at sa-stats.pl line 280, <GEN0>
line 28840.
Use of uninitialized value in sprintf at sa-stats.pl line 280, <GEN0> line
28840.
Use of uninitialized value in division (/) at sa-stats.pl line 283, <GEN0>
line 28840.
Use of uninitialized value in sprintf at sa-stats.pl line 283, <GEN0> line
28840.
Use of uninitialized value in sprintf at sa-stats.pl line 286, <GEN0> line
28840.
Report Title : SpamAssassin - Spam Statistics
Report Date : 2004-03-06
Period Beginning : Sat 06 Mar 2004 02:47:25 PM EST
Period Ending : Sun 07 Mar 2004 02:47:25 PM EST

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

Note: 'ham' = 'nonspam'

Total spam detected : 0 ( 0.00%)
Total ham accepted : 0 ( 0.00%)
-------------------
Total emails processed : 0 ( 0/hr)

Average spam threshold : 0.00
Average spam score : 0.00
Average ham score : 0.00

Spam kbytes processed : 0 ( 0 kb/hr)
Ham kbytes processed : 0 ( 0 kb/hr)
Total kbytes processed : 0 ( 0 kb/hr)

Spam analysis time : 0 s ( 0 s/hr)
Ham analysis time : 0 s ( 0 s/hr)
Total analysis time : 0 s ( 0 s/hr)


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


Done. Report generated in 279 sec.
[root@wa9als john]# of uninitialized value in division (/) at sa-stats.pl
line 271, <GEN0> line 28840.
-bash: syntax error near unexpected token `('
[root@wa9als john]# Use of uninitialized value in division (/) at
sa-stats.pl line 271, <GEN0> line 28840.
-bash: syntax error near unexpected token `('
[root@wa9als john]# Use of uninitialized value in division (/) at
sa-stats.pl line 274, <GEN0> line 28840.
-bash: syntax error near unexpected token `('
[root@wa9als john]# Use of uninitialized value in division (/) at
sa-stats.pl line 274, <GEN0> line 28840.
-bash: syntax error near unexpected token `('
[root@wa9als john]#
Re: sa-stats help? [ In reply to ]
On Sat, 6 Mar 2004 14:56:23 -0500 "John Fleming" <john@wa9als.com> wrote:

> Where is any info about any required setup prior to running sa-stats?

Do `perldoc sa-stats.pl` for documentation.

Also, try

./sa-stats.pl --start "today midnight" --end "now" --logfile /var/log/mail

substituting the name of your local mail logfile.

-- Bob
Re: sa-stats help? [ In reply to ]
> Do `perldoc sa-stats.pl` for documentation.
>
> Also, try
>
> ./sa-stats.pl --start "today midnight" --end "now" --logfile /var/log/mail
>
> substituting the name of your local mail logfile.

Thanks, Bob. Do I have to be running Sendmail, or can it work with
Postfix?? - John
Re: sa-stats help? [ In reply to ]
On Sat, Mar 06, 2004 at 04:15:38PM -0600, Bob Apthorpe wrote:
> On Sat, 6 Mar 2004 14:56:23 -0500 "John Fleming" <john@wa9als.com> wrote:
>
> > Where is any info about any required setup prior to running sa-stats?
>
> Do `perldoc sa-stats.pl` for documentation.
>
> Also, try
>
> ./sa-stats.pl --start "today midnight" --end "now" --logfile /var/log/mail
>
> substituting the name of your local mail logfile.
>
> -- Bob

I did the above, using spamassassin 2.63, Perl 5.8.0 on a RedHat 9 system,
using sa-stats.pl from the spamassassin 3 tools directory, and I get:

Malformed UTF-8 character (byte 0xfe) at /usr/lib/perl5/vendor_perl/5.8.0/Date/Manip.pm line 5902.
Malformed UTF-8 character (unexpected non-continuation byte 0x6d, immediately after start byte 0xee) at /usr/lib/perl5/vendor_perl/5.8.0/Date/Manip.pm line 5902.
Malformed UTF-8 character (unexpected non-continuation byte 0x74, immediately after start byte 0xe3) at /usr/lib/perl5/vendor_perl/5.8.0/Date/Manip.pm line 5902.
.
<snip a lot of the same>
.
.
Can't locate Parse/Syslog.pm in @INC (@INC contains: /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 .) at ./sa-stats.pl line 50.
BEGIN failed--compilation aborted at ./sa-stats.pl line 50.


What's up with that?

thanks,
-chuck
RE: sa-stats help? [ In reply to ]
I've seen lots of that kind of stuff on RedHat.

Check your language settings:

(for bash)

>export lang="en_US"

Then try again.

-=Ray
+-----------------------------------------------------------+
| | Ray Anderson |
| | | Systems Development Manager |
| | | 916.788.2444 (Office) |
| (O) | 916.798.9439 (Mobile) |
|X--------<_._>--------X | PRIDE Industries |
| (___) | |
| | http://www.prideindustries.com |
+-----------------------------------------------------------+
Only the spirit of attack borne in a brave heart will bring success to any
fighter aircraft, no matter how highly developed it may be.
Lt. General Adolph Galland, Luftwaffe


> -----Original Message-----
> From: Chuck Campbell [mailto:campbell@accelinc.com]
> Sent: Wednesday, March 10, 2004 8:05 AM
> To: Bob Apthorpe
> Cc: spamassassin-users@incubator.apache.org
> Subject: Re: sa-stats help?
>
>
> On Sat, Mar 06, 2004 at 04:15:38PM -0600, Bob Apthorpe wrote:
> > On Sat, 6 Mar 2004 14:56:23 -0500 "John Fleming"
> <john@wa9als.com> wrote:
> >
> > > Where is any info about any required setup prior to
> running sa-stats?
> >
> > Do `perldoc sa-stats.pl` for documentation.
> >
> > Also, try
> >
> > ./sa-stats.pl --start "today midnight" --end "now"
> --logfile /var/log/mail
> >
> > substituting the name of your local mail logfile.
> >
> > -- Bob
>
> I did the above, using spamassassin 2.63, Perl 5.8.0 on a
> RedHat 9 system,
> using sa-stats.pl from the spamassassin 3 tools directory, and I get:
>
> Malformed UTF-8 character (byte 0xfe) at
> /usr/lib/perl5/vendor_perl/5.8.0/Date/Manip.pm line 5902.
> Malformed UTF-8 character (unexpected non-continuation byte
> 0x6d, immediately after start byte 0xee) at
> /usr/lib/perl5/vendor_perl/5.8.0/Date/Manip.pm line 5902.
> Malformed UTF-8 character (unexpected non-continuation byte
> 0x74, immediately after start byte 0xe3) at
> /usr/lib/perl5/vendor_perl/5.8.0/Date/Manip.pm line 5902.
> .
> <snip a lot of the same>
> .
> .
> Can't locate Parse/Syslog.pm in @INC (@INC contains:
> /usr/lib/perl5/5.8.0/i386-linux-thread-multi
> /usr/lib/perl5/5.8.0
> /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
> /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl
> /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
> /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl
> /usr/lib/perl5/5.8.0/i386-linux-thread-multi
> /usr/lib/perl5/5.8.0 .) at ./sa-stats.pl line 50.
> BEGIN failed--compilation aborted at ./sa-stats.pl line 50.
>
>
> What's up with that?
>
> thanks,
> -chuck
>
Re: sa-stats help? [ In reply to ]
Hi,

On Wed, 10 Mar 2004 10:05:05 -0600 Chuck Campbell <campbell@accelinc.com> wrote:

> On Sat, Mar 06, 2004 at 04:15:38PM -0600, Bob Apthorpe wrote:
> > On Sat, 6 Mar 2004 14:56:23 -0500 "John Fleming" <john@wa9als.com> wrote:
> >
> > > Where is any info about any required setup prior to running sa-stats?
> >
> > Do `perldoc sa-stats.pl` for documentation.
> >
> > Also, try
> >
> > ./sa-stats.pl --start "today midnight" --end "now" --logfile /var/log/mail
> >
> > substituting the name of your local mail logfile.
> >
> > -- Bob
>
> I did the above, using spamassassin 2.63, Perl 5.8.0 on a RedHat 9 system,
> using sa-stats.pl from the spamassassin 3 tools directory, and I get:
>
> Malformed UTF-8 character (byte 0xfe) at /usr/lib/perl5/vendor_perl/5.8.0/Date/Manip.pm line 5902.
> Malformed UTF-8 character (unexpected non-continuation byte 0x6d, immediately after start byte 0xee) at /usr/lib/perl5/vendor_perl/5.8.0/Date/Manip.pm line 5902.
> Malformed UTF-8 character (unexpected non-continuation byte 0x74, immediately after start byte 0xe3) at /usr/lib/perl5/vendor_perl/5.8.0/Date/Manip.pm line 5902.

I've never seen that but I'm guessing it's a locale problem (common with
RH >7).

What does this give you?:

perl -MDate::Manip -e 'print $Date::Manip::VERSION,"\n";'

I'm running with Date::Manip 5.42; I looked in the Date::Manip source -
they may have included high-bit characters for internationalization
which might be misinterpreted as UTF-8. I don't know.

Also, what does this do (but see below first for the answer to the
Parse::Syslog question):

LANG=en_US ./sa-stats.pl --start "today midnight" --end "now" --logfile /var/log/mail

('LANG' bit stolen from Ray's post...)

Q: is the RH mail log in /var/log/mail or /var/log/maillog ?

> Can't locate Parse/Syslog.pm in @INC (@INC contains: /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 .) at ./sa-stats.pl line 50.
> BEGIN failed--compilation aborted at ./sa-stats.pl line 50.
>
>
> What's up with that?

That one's easy - install Parse::Syslog. This keeps us from writing our
own redundant, broken syslog parsing routine. IIRC, Parse::Syslog and
Date::Manip are the only two CPAN dependencies for sa-stats.pl; they
should be listed in the docs.

-- Bob
Re: sa-stats help? [ In reply to ]
On Wed, Mar 10, 2004 at 10:42:58AM -0600, Bob Apthorpe wrote:
> Hi,
>
> On Wed, 10 Mar 2004 10:05:05 -0600 Chuck Campbell <campbell@accelinc.com> wrote:
> >
> > Malformed UTF-8 character (byte 0xfe) at /usr/lib/perl5/vendor_perl/5.8.0/Date/Manip.pm line 5902.
> > Malformed UTF-8 character (unexpected non-continuation byte 0x6d, immediately after start byte 0xee) at /usr/lib/perl5/vendor_perl/5.8.0/Date/Manip.pm line 5902.
> > Malformed UTF-8 character (unexpected non-continuation byte 0x74, immediately after start byte 0xe3) at /usr/lib/perl5/vendor_perl/5.8.0/Date/Manip.pm line 5902.
>
> I've never seen that but I'm guessing it's a locale problem (common with
> RH >7).

yep, setting LANG to en_US instead of en_US.UTF8 makes those problems go away.

> What does this give you?:
>
> perl -MDate::Manip -e 'print $Date::Manip::VERSION,"\n";'

{campbell}68: % perl -MDate::Manip -e 'print $Date::Manip::VERSION,"\n";'
5.40

> I'm running with Date::Manip 5.42; I looked in the Date::Manip source -
> they may have included high-bit characters for internationalization
> which might be misinterpreted as UTF-8. I don't know.
>
> Also, what does this do (but see below first for the answer to the
> Parse::Syslog question):
>
> LANG=en_US ./sa-stats.pl --start "today midnight" --end "now" --logfile /var/log/mail
>
> ('LANG' bit stolen from Ray's post...)
>
> Q: is the RH mail log in /var/log/mail or /var/log/maillog ?

it is /var/log/maillog, but it doesn't matter yet, I'm still seeing this:

{campbell}71: % ./sa-stats.pl --start "today midnight" --end "now" --logfile /var/log/maillog
Can't locate Parse/Syslog.pm in @INC (@INC contains: /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.0/i386-linux-thread-multi /usr/lib/perl5/5.8.0 .) at ./sa-stats.pl line 50.
BEGIN failed--compilation aborted at ./sa-stats.pl line 50.

> > What's up with that?
>
> That one's easy - install Parse::Syslog. This keeps us from writing our
> own redundant, broken syslog parsing routine. IIRC, Parse::Syslog and
> Date::Manip are the only two CPAN dependencies for sa-stats.pl; they
> should be listed in the docs.
>
> -- Bob

Does this not get installed with spamassassin? I've stuck with the RedHat
provided spamassassin rpm's, to avoid all the other issues that come with
doing cpan installs, outside of rpm.

I assume I'm stuffed this time around, and I'll have to do a cpan install, which
will play hell with everything else that wants to use those things...

Or, do without sa-stats.pl?

-chuck
Re: sa-stats help? [ In reply to ]
Hi,

On Wed, 10 Mar 2004, Chuck Campbell wrote:

> On Wed, Mar 10, 2004 at 10:42:58AM -0600, Bob Apthorpe wrote:

> > That one's easy - install Parse::Syslog. [...]
>
> Does this not get installed with spamassassin? I've stuck with the
> RedHat provided spamassassin rpm's, to avoid all the other issues that
> come with doing cpan installs, outside of rpm.
>
> I assume I'm stuffed this time around, and I'll have to do a cpan
> install, which will play hell with everything else that wants to use
> those things...

Not necessarily; IIRC there's a cpan2rpm script somewhere
(http://perl.arix.com/cpan2rpm/) which will let you roll your own RPMs
from CPAN tarballs. You can still do pure RPM configuration management by
building your own packages and IIRC Parse::Syslog is pure perl with no
external dependencies so it should package pretty easily.

That's a problem with RPMs; there's no way a vendor can package
*everything*.

> Or, do without sa-stats.pl?

Or hack the syslog parsing code back in (you can probably do this with a
split() or a simple regex. It's not terribly difficult; Parse::Syslog
handles some Solaris weirdness, making sa-stats.pl a little more robust.

hth,

-- Bob