ASSP antispam statistics

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

luuk
Posts: 4
Joined: Mon Mar 08, 2004 9:01 am

ASSP antispam statistics

Post by luuk »

Here my export of the ASSP antispam statistics.
Attachments
assp.jpg
assp.jpg (70.01 KiB) Viewed 39923 times
cacti_data_template_assp_statistics.xml
(6.8 KiB) Downloaded 1642 times
cacti_graph_template_assp_antispam_statistics.xml
(21.91 KiB) Downloaded 1795 times
luuk
Posts: 4
Joined: Mon Mar 08, 2004 9:01 am

Post by luuk »

here the perl script
Attachments
asspstats.zip
(935 Bytes) Downloaded 1508 times
anTIDot
Posts: 7
Joined: Wed Mar 16, 2005 4:16 am
Contact:

Post by anTIDot »

SENKS
cybaspace
Posts: 2
Joined: Thu Aug 11, 2005 11:29 am

Post by cybaspace »

When I try to download the assp script, I download 'download.php' ?
I assume that isn't correct. Anywhere else where I can get that script?
cybaspace
Posts: 2
Joined: Thu Aug 11, 2005 11:29 am

Post by cybaspace »

Ah, the name seems to be wrong. Renamed download.php to download.zip and it works!
PN
Posts: 1
Joined: Mon Jul 10, 2006 5:27 am

ASSP v1.2.3(0) problem ...

Post by PN »

The previuos script does not seem to work for a newer version of ASSP (current version 1.2.3) since the page has changed to infostats ...

How can I attach to that page from this script ?
We are running ASSP as a service on a windows 2003 server.

When i try to connect i get this message:

http://<user>:<password>@<ipaddress>:55555/infostatsHTTP::Request=HASH(0x82fc89c)HTTP::Response=HASH(0x8485800)

Any clue how to solve this problem ?
issmsatch
Posts: 18
Joined: Sun Oct 01, 2006 2:43 am
Location: TX USA

Post by issmsatch »

Hi. I'm using CactiEZ ISO, Cacti version 0.8.6h. Also running ASSP 1.2.3 on the same box.

I don't have this working yet, but think I'm close. Think it may be the modified script takes to long to return the result?

Had to install the Perl LWP module first (required by asspstats.pl).
After tweaking asspstats.pl and when run from the command line I now get:
totalmessages:140476 smtpconnections:206954 bayesianspams:47896 localmails:4299 whitelistedmail:12681



The infostats page has changed so asspstats.pl script needs 5 lines to be updated:

pre v1.2.3 asspstats.pl:
if ($line2 =~ /optionValue">(\d+)<\/td/i) {

v1.2.3 asspstats.pl:
if ($line2 =~ /2">(\d+)<\/td/i) {

The other things I ran into is that the last line of the original script was:
print "\n smtpcon:$smtpcon totmess:$totmess bayspam:$bayspam locmail:$locmail whitemail:$whitemail\n\n";

I changed mine to match the rrd file info:
print "\n totalmessages:$totmess smtpconnections:$smtpcon bayesianspams:$bayspam localmails:$locmail whitelistedmail:$whitemail\n\n";

I followed the instructions on troubleshooting, used the rrdtool to increase the maximum values, cleared the poller cache, ran both cactid and cmd.ph pollers. Also ran the poller from the command line as apache. The poller and log file both show:

10/01/2006 05:05:06 PM - CMDPHP: Poller[0] Host[1] DS[27] WARNING: Result from CMD not valid. Partial Result:
10/01/2006 05:05:06 PM - CMDPHP: Poller[0] Host[1] DS[27] CMD: perl /var/www/html/scripts/asspstats.pl, output: U
10/01/2006 05:05:06 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "insert into poller_output (local_data_id,rrd_name,time,output) values (27,'','2006-10-01 17:05:03','U')"

File is still full of NaN's.

I haven't tried hitting the URL from an external Cacti box to see if it that works.

Any ideas?

Thanks for any help.
issmsatch
Posts: 18
Joined: Sun Oct 01, 2006 2:43 am
Location: TX USA

Post by issmsatch »

I need to see if there's a way to increase the time to wait for the response from a script. Sometimes it takes a few seconds to get a response.

I have this working intermittently, here's what I've done so far:

Rebuilt the graph & data templates. (The instructions how to do this were helpful but need to be updated)

I changed the last line of the asspstats.pl script back to the original statement=
print "\n smtpcon:$smtpcon totmess:$totmess bayspam:$bayspam locmail:$locmail whitemail:$whitemail\n\n";

Still needed to change 5 lines in the original asspstats.pl:
if ($line2 =~ /optionValue">(\d+)<\/td/i) {
to:
if ($line2 =~ /2">(\d+)<\/td/i) {

Settings>Log Level = DEBUG.

WTF? It started working! Kind of. For awhile.

Set Log levels to default and it was still working. Then it quit several hours later after logrotate exited abnormally and sylog didn't restart. Now it's not working after a reboot.

The script runs from the command line, the only thing I can think is that it takes 5 to 10 seconds to get a response.

using
rrdtool fetch <your-rra-file>.rra LAST
was helpful to see if the .rra file was or was not updated.

I'll upgrade from 1.2.3 to a newer version within the next couple of weeks and maybe find a kludge that works more consistently. Logrotate & syslog problems have given me some grief too.
issmsatch
Posts: 18
Joined: Sun Oct 01, 2006 2:43 am
Location: TX USA

Post by issmsatch »

The script is taking 7 to 10 seconds to provide output. Under Settings, I increased from 25 to 70 seconds, increased threads from 1 to 2. Log file shows the :U 7 seconds after the script was run.

I've done some more searches, but not found any posts related to the "Script and Script Server Timeout Value" not being honored. I took it from 25 to 70 with the same result.

Here's the log event:
10/08/2006 11:55:07 PM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/www/html/rra/assp_whitelistedmail_17.rrd --template 1160369706:U

Seems like the U: would not be in the log until 11:56:10 if it was waiting 70 seconds and not getting a response.
cooper76
Posts: 6
Joined: Tue Oct 10, 2006 1:50 pm

Post by cooper76 »

So what are the steps to get this working? I have the asspstats.pl script in the scripts folder and both of the xml files imported in Cacti. Do I need to add a device in Cacti, since the device info is already in the asspstats.pl script?

This is my first time using a third-party script/template.

Thanks
cooper76
Posts: 6
Joined: Tue Oct 10, 2006 1:50 pm

Post by cooper76 »

Forget about my last post, I seem to have it working. Now the problem that I have is that script is not returning results back to Cacti. This is the error that I'm getting now.

WARNING: Result from CMD not valid. Partial Result:

Anyone seen this before?
cooper76
Posts: 6
Joined: Tue Oct 10, 2006 1:50 pm

Post by cooper76 »

I got it working and NaN messages are gone. I had to make a change to the asspstats.pl script. I removed all the "/n" from the print statement. So my print looks like this.

print "smtpcon:$smtpcon totmess:$totmess bayspam:$bayspam locmail:$locmail whitemail:$whitemail";


BTW, I'm using the 1.2.4 of ASSP
issmsatch
Posts: 18
Joined: Sun Oct 01, 2006 2:43 am
Location: TX USA

Post by issmsatch »

Cooper76,

Hey that's great!

Are you using the original asspstats.pl script or did you modify it?
cooper76
Posts: 6
Joined: Tue Oct 10, 2006 1:50 pm

Post by cooper76 »

I did modified it with your changes:

Changed those 5 lines, like you did
if ($line2 =~ /2">(\d+)<\/td/i) {

And I changed the last line (the "print" line) which I noted in my previous post.

EDIT: I also changed a part of the $starturl line:
before:
$starturl = 'http://'.$username.':'.$passwd.'@'. $ipaddress.':55555/stats';
after:
$starturl = 'http://'.$username.':'.$passwd.'@'. $ipaddress.':55555/infostats';
User avatar
pgus
Cacti User
Posts: 55
Joined: Fri Feb 10, 2006 9:54 am

Please post a working asspstats.pl

Post by pgus »

Hi!

Can you please post your working asspstats.pl in forum?

Thanks in advance
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests