Sendmail & Mailscanner (alternate)

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

Moderators: Developers, Moderators

dinfiesta
Posts: 8
Joined: Thu Nov 24, 2005 7:52 am

Re: ok

Post by dinfiesta »

yianniska wrote:import is ok but still i cannot get any graphs
when i try to create the graphs

i get this error

RRDTool Says:

ERROR: opening '/var/www/html/cacti0.8.6d/rra/eml2_mess_recv_62.rrd': No such file or directory.

i 've put the scripts to the mail server
i also put the extra lines in my ucdsnmp.conf
but no luck.

could you please help me with this because i find this graphs very
nice

thanks
I have same issue:

ERROR: opening '/var/www/html/cacti/rra/springfield_mess_recv_71.rrd': No such file or directory

Why it does not create graphics?
HyTeK
Posts: 11
Joined: Sat Dec 03, 2005 11:01 am

Post by HyTeK »

any updates to this yet? I really want to use this particular script, but earlier someone stated they were rewriting it for an easier install. I wouldn't mind waiting a bit longer if it isn't to far off from being done.

Any word on that?

Cheers.
stevewest15
Posts: 9
Joined: Tue Oct 25, 2005 1:09 pm

Post by stevewest15 »

warnesj wrote:The new version should be a bit easier to setup.
Hopefully testing is going well? Can't wait to see what you got :D

SW
polosport
Posts: 9
Joined: Tue Dec 13, 2005 5:31 pm
Location: Los Angeles, CA

Post by polosport »

Is there any update to this? I'm looking forward to getting this working. I was able to get the graph to display, but all the numbers are staying at 0. Any ideas?
centyx
Posts: 4
Joined: Tue Jan 10, 2006 4:24 pm

incoming/outgoing message tracking with sendmail

Post by centyx »

Greetings. I'm using these scripts as a starting point, but want to make a few modifications. I have already opted to go with BFD's (http://www.rfxnetworks.com/bfd.php) tlog script for managing the tailing of the log file instead of the time_trigger. This makes more sense to me. What I am trying to figure out now is a way of measuring incoming and outgoing messages in sendmail without having to list the domains on the server. This is not practical, as new domains are added frequently, and the list is quite long. Has anyone found an alternate solution?
centyx
Posts: 4
Joined: Tue Jan 10, 2006 4:24 pm

Post by centyx »

These machines are running Ensim, so I decided to have the scripts look for "mailer=virthostmail" and "stat=Sent" for incoming, and "mailer=esmtp" and "stat=Sent" for outgoing. That fixed that.

Now if only I could get the graph template to import successfully ;-s
Getting the error:

Error: XML: Cacti version does not exist.

Using Cacti 0.8.6g.

EDIT: Upgrading to 0.8.6h fixed that.
centyx
Posts: 4
Joined: Tue Jan 10, 2006 4:24 pm

Post by centyx »

Has anyone found a way to display the total number of sent/received/spam/virus messages in a comment, similar to the way total bandwidth usage can be displayed?
mandrk
Posts: 21
Joined: Thu May 12, 2005 1:32 am
Location: Romania
Contact:

I have some problem with template

Post by mandrk »

I use fedora core3
Everything same to be ok but no graphic.
----------------
RRDTool Says:
ERROR: opening '/var/www/html/monitoring/rra/mydomain_com_mess_recv_225.rrd': No such file or directory
--------------------
In Data source when i use in debug mode:
---------------------
/usr/bin/rrdtool create \
/var/www/html/monitoring/rra/mydomain_com_mess_recv_229.rrd \
--step 300 \
DS:mess_sent:GAUGE:600:0:100000000 \
DS:mess_recv:GAUGE:600:0:100000000 \
RRA:AVERAGE:0.5:1:600 \
RRA:AVERAGE:0.5:6:700 \
RRA:AVERAGE:0.5:24:775 \
RRA:AVERAGE:0.5:288:797 \
RRA:MAX:0.5:1:600 \
RRA:MAX:0.5:6:700 \
RRA:MAX:0.5:24:775 \
RRA:MAX:0.5:288:797 \
--------------------
i run in /opt the scripts
-----------
./count_recv.sh
.1.3.6.1.4.100.5
gauge
0
./count_sent.sh
.1.3.6.1.4.100.6
gauge
1
-------------
xoyox
Posts: 1
Joined: Mon Mar 27, 2006 5:35 am

Error: XML: Hash version does not exist.

Post by xoyox »

When I add your template it says to me :"Error: XML: Hash version does not exist." ??
Atreillou
Posts: 2
Joined: Fri Apr 28, 2006 8:46 am

Post by Atreillou »

hi,


i try to use this script

Code: Select all


[root@server]:[/usr/share/cacti/site/scripts/sendmail]#cat recu.sh
#!/bin/sh
echo .1.3.6.1.4.100.5
echo gauge
tail -n 5000 /var/log/mail.info|awk '
BEGIN {
        search_time = "^" strftime("%b %e %H:%M:%S", systime() - 5 * 60);
        search_sent = "stat=Sent";
        search_domain_1 = "@atreillou.com";
        recv_count = 0;
        }
{
        if ($0 ~ search_time && $0 ~ search_sent) time_trigger = 1;
        if ($0 ~ search_sent) is_sent_trigger = 1;
        if ($0 ~ search_domain_1) is_domain_trigger = 1;
        if ($0 ~ search_domain_2) is_domain_trigger = 1;
        if (time_trigger && is_sent_trigger && is_domain_trigger) recv_count++;
        is_sent_trigger = 0;
        is_domain_trigger = 0;
}
END { print recv_count; }'
exit
but it's only work when i remove search_time line:

Code: Select all

[root@server]:[/usr/share/cacti/site/scripts/sendmail]#diff recu.sh recunodate.sh
6c6
<         search_time = "^" strftime("%b %e %H:%M:%S", systime() - 5 * 60);
---
> #        search_time = "^" strftime("%b %e %H:%M:%S", systime() - 5 * 60);

Code: Select all


[root@server]:[/usr/share/cacti/site/scripts/sendmail]#sh recu.sh
.1.3.6.1.4.100.5
gauge
0
[root@server]:[/usr/share/cacti/site/scripts/sendmail]#sh recunodate.sh
.1.3.6.1.4.100.5
gauge
48


it's the same problem with mailstats.sh, sent.sh etc


Any idea ?

I sent/receive 10 mail in last 5 minutes for the test


one log line:

Code: Select all

[root@server]:[/usr/share/cacti/site/scripts/sendmail]#tail -n 1 /var/log/mail.info
May  2 11:08:36 server sendmail[26267]: k422ejU9019740: to=<nicholas@paramed.biz>, delay=06:27:51, xdelay=00:03:09, mailer=esmtp, pri=3118721, relay=paramed.biz. [204.251.15.174], dsn=4.0.0, stat=Deferred: Connection timed out with paramed.biz.
yetdog
Posts: 20
Joined: Mon Aug 08, 2005 9:40 am

Post by yetdog »

Oddly enough, while the script works to collect the data:

[root@MAILER-02]# ./stats2.sh
.1.3.6.1.4.100.6
gauge
Start time: 20060509101112
Year run: 2006
3890

And I put the correct lines into snmpd.conf and restart snmpd:

#Count the number of Spam messages dropped by spamass in the last 5 minutes
pass .1.3.6.1.4.100.6 /bin/sh /path/to/stats2.sh

When I run:
snmpget -v 1 -c public IP_ADDRESS .1.3.6.1.4.100.6

I get this:

Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: SNMPv2-SMI::private.100.6

Weird??!?? Any ideas?
enhan
Posts: 1
Joined: Tue May 30, 2006 7:17 pm

Re: ok

Post by enhan »

dinfiesta wrote:
yianniska wrote:import is ok but still i cannot get any graphs
when i try to create the graphs

i get this error

RRDTool Says:

ERROR: opening '/var/www/html/cacti0.8.6d/rra/eml2_mess_recv_62.rrd': No such file or directory.

i 've put the scripts to the mail server
i also put the extra lines in my ucdsnmp.conf
but no luck.

could you please help me with this because i find this graphs very
nice

thanks
I have same issue:

ERROR: opening '/var/www/html/cacti/rra/springfield_mess_recv_71.rrd': No such file or directory

Why it does not create graphics?
Has anyone managed to get this to work, I've done a fair bit with mrtg, rrdtool and cacti as well, but I can't get this to make any graphs, even though the snmp stuff works fine!
renow
Posts: 2
Joined: Thu Jun 29, 2006 7:37 am

count_recv.sh missing mails ?

Post by renow »

Hi,

It seems this script search for a line with 5 minutes before now and a sent mail, but if we don't have sent mail at this moment but just one or more minute(s) later the counter isn't incremented at all.

I'm not very good in awk syntax, maybe there is a nicer way to do that, but I think the script should be :

Code: Select all

#!/bin/sh
echo .1.3.6.1.4.100.5
echo gauge
tail -n 5000 /var/log/maillog|awk '
BEGIN {
        search_time1 = "^" strftime("%b %e %H:%M", systime() - 5 * 60);
        search_time2 = "^" strftime("%b %e %H:%M", systime() - 4 * 60);
        search_time3 = "^" strftime("%b %e %H:%M", systime() - 3 * 60);
        search_time4 = "^" strftime("%b %e %H:%M", systime() - 2 * 60);
        search_time5 = "^" strftime("%b %e %H:%M", systime() - 1 * 60);
        search_sent = "status=sent";     #for postfix
        search_domain_1 = "@domain.com";          
        search_domain_2 = "@domain.org";
        recv_count = 0;
        }
{
        if (($0 ~ search_time1 || $0 ~ search_time2 || $0 ~ search_time3 || $0 ~ search_time4 || $0 ~ search_time5) && $0 ~ search_sent) time_trigger = 1;
        if ($0 ~ search_sent) is_sent_trigger = 1;
        if ($0 ~ search_domain_1) is_domain_trigger = 1;
        if ($0 ~ search_domain_2) is_domain_trigger = 1;
        if (time_trigger && is_sent_trigger && is_domain_trigger) recv_count++;
        is_sent_trigger = 0;
        is_domain_trigger = 0;
}
END { print recv_count; }'
exit
Am I wrong ?
renow
Posts: 2
Joined: Thu Jun 29, 2006 7:37 am

Post by renow »

sorry, I'd missed the page 2 of the post ;-(

I have now the classical issue : no graph...


Here is my log

RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="NEOMAIL - E-Mail Statistics" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="# of Messages" \
--slope-mode \
DEF:a="/var/www/htdocs/cacti/rra/neomail_mess_recv_146.rrd":mess_recv:AVERAGE \
DEF:b="/var/www/htdocs/cacti/rra/neomail_viruses_145.rrd":viruses:AVERAGE \
DEF:c="/var/www/htdocs/cacti/rra/neomail_viruses_145.rrd":spam:AVERAGE \
DEF:d="/var/www/htdocs/cacti/rra/neomail_mess_recv_146.rrd":mess_sent:AVERAGE \
CDEF:cdefbd=d,-1,* \
AREA:a#00CF00:"Messages Recieved" \
GPRINT:a:LAST:"Current\:%8.0lf" \
GPRINT:a:AVERAGE:"Average\:%8.0lf" \
GPRINT:a:MAX:"Maximum\:%8.0lf\n" \
AREA:b#FF0000:"Viruses" \
GPRINT:b:LAST:" Current\:%8.0lf" \
GPRINT:b:AVERAGE:"Average\:%8.0lf" \
GPRINT:b:MAX:"Maximum\:%8.0lf\n" \
AREA:c#EA8F00:"SPAM":STACK \
GPRINT:c:LAST:" Current\:%8.0lf" \
GPRINT:c:AVERAGE:"Average\:%8.0lf" \
GPRINT:c:MAX:"Maximum\:%8.0lf\n" \
COMMENT:"\n" \
AREA:cdefbd#7CB3F1:"Messages Sent" \
GPRINT:d:LAST:" Current\:%8.0lf" \
GPRINT:d:AVERAGE:"Average\:%8.0lf" \
GPRINT:d:MAX:"Maximum\:%8.0lf"

RRDTool Says:

ERROR: opening '/var/www/htdocs/cacti/rra/neomail_mess_recv_146.rrd': No such file or directory
warnesj
Cacti User
Posts: 173
Joined: Sun May 29, 2005 7:34 pm

Post by warnesj »

Hi all, I'm back! Sorry for being MIA for a while and missed out on all the questions. I'm terribly sorry.

I just wanted to post in this thread that I've finally finished the new version of the scripts and templates. These ones are WAY more effecient! No longer do the scripts beat the hell out of your mail severs to find out what's going on. Also these new scripts can handle servers that have high load, so no more graphs with gaps in them! :)

I'm just letting the scripts run for the next 24 hours on my servers just to test them for a while. So baring any problems in the next 24 hours, come tommorow I'll create a new post for the new version. Hopefully any outstanding problems will be solved in the new version. But then again, maybe not. :-?
Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests