exim statistics

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

Moderators: Developers, Moderators

chrome
Posts: 13
Joined: Fri May 13, 2005 1:38 am

exim statistics

Post by chrome »

this was split off ofhttp://forums.cacti.net/viewtopic.php?t=7609
Reinhard


Hi Paul,

I was going to generalise this before I posted it to the templates/plugins forums, but I don't have time right now. You can see where it is headed though, so hopefully you can take my code and modify it to your needs.

In particular, you will need to modify the regexes to match the transports you have in your config, as well as the definitions of the variables above that part, and the part where it prints out the stats.

Then, cron the script to run every 5 minutes, and redirect the output to /etc/snmp/exim_perf.stats (or wherever you want).

All this script does is do the equivalent of a stateful 'tail' on the exim main.log. It remembers where it finished reading the file the last time, and continues from there, only feeding the new lines to eximstats. When the logfile gets rotated, it processes the last of old one first before processing the new one.

The code isn't pretty, its really just a prototype, but it works.

in your snmpd.conf file you need:

Code: Select all

exec .1.3.6.1.4.1.14464.25 exim_perf.pl /bin/cat /etc/snmp/exim_perf.stats
I do it this way to avoid eximstats from forking off for every oid that gets hit when you smack the snmpd. 'cat' is probably a little less overhead.

When you cron the exim_perf.pl script, make sure you cron it on different 5 minute intervals to the poller. You don't want them butting heads at the same time. Its ok for the stats to be a couple of minutes behind imho.

If you have a cluster of machines, I also have another script that can summarise the stats for any number of machines. Let me know if you want me to post it.

I intend to clean all this up someday soon and make some templates; but its difficult because everyone has their own transports defined.
Attachments
exim_perf.pl.zip
(1.23 KiB) Downloaded 4066 times
chrome
Posts: 13
Joined: Fri May 13, 2005 1:38 am

Post by chrome »

A prettier example :)
Attachments
graph_image-1.png
graph_image-1.png (67.06 KiB) Viewed 60475 times
chrome
Posts: 13
Joined: Fri May 13, 2005 1:38 am

Post by chrome »

Here is the graph template with dependencies ... i have no idea if any of this will work if you just throw it in.
Attachments
cacti_graph_template_exim_delivery_statistics.xml
(37.45 KiB) Downloaded 3398 times
Paul Thexton
Posts: 49
Joined: Tue Jan 18, 2005 7:50 am

Post by Paul Thexton »

Excellent - thanks for that, I'll give them ago!
Hildebrand
Posts: 18
Joined: Thu Oct 27, 2005 9:24 am
Location: Germany, Bavaria

Post by Hildebrand »

Thanks for this Script!

I must modified the Transporters in your Script and don´t know how!? :roll:
I looked into the pearl Script and set for example the "ClamAV" to "ditch_malware" but it wont work! Because in my mainlog of Exim is nothing with ClamAV, the one thing i have seen was "ditch_maleware" and "ditch_spam". But this no transporter? Or is this right?

Here some lines of the mainlog:

Code: Select all

2005-11-24 07:38:56 1EfAky-0001hh-Fv <= zeuankifep@yahoo.com H=mforward.dtag.de [194.25.242.123] P=esmtp S=2385 id=b7288t3HL7Q801L95WH51NSV80762666B204858@221.196.105.22 T="lowCostDrugs!" from <zeuankifep@yahoo.com> for brennstoffe@mydomain.tdl
2005-11-24 07:38:56 1EfAky-0001hh-Fv => :blackhole: <b.myname@mydomain.tdl> R=ditch_spam
Output of your Script after the modification:

Code: Select all

mail:/usr/local/share/cacti/scripts# ./exim_perf.pl
rejected
0
virtual_delivery
7
remote_smtp
2
ditch_spam
0
ditch_malware
0
remote_smtp_single_recipient_domains
0
mail:/usr/local/share/cacti/scripts#
In the mainlog of EXIM are also "rejected" mails that i wont into the Cacti Graph, but i don´t know what to do! Here is an example:

Code: Select all

2005-11-24 07:05:16 H=mforward.dtag.de [194.25.242.123] F=<Downloads@BKA.de> rejected RCPT <6.00.2900.2180katarzyna@mydomain.tdl>: Unknown user
Thanks 4 help!!
Hildebrand
aleto
Posts: 39
Joined: Wed May 25, 2005 3:57 am

Post by aleto »

ANyone had luck with these scripts? Ive setted everything up as request but no luck, graphs keep saying NAN.. but they d
umbroboy
Posts: 9
Joined: Thu Apr 06, 2006 4:28 pm

Post by umbroboy »

i try to install the exim4 log.

and it works i think, but i dont know what i must choose in:

Data Source [exim_clamcheck]
The data source to use for this graph item.
Data Source [exim_local_delivery]
The data source to use for this graph item.
Data Source [exim_remote_smtp]
The data source to use for this graph item.
Data Source [exim_single_recipie]
The data source to use for this graph item.
Data Source [exim_spamcheck]
The data source to use for this graph item.
Data Source [exim_trend_micro]
The data source to use for this graph item.


Load Average 15 min?

thanks
marcus
Overflower
Posts: 3
Joined: Fri Oct 27, 2006 1:03 am

Cacti not updating

Post by Overflower »

Hi Guys,

I'm running this script now. But I does not get update in any way.
The exim_perf.pl does ouput info but if I walk the system with snmpwalk all the request come back with "0".

I added this ling to my snmpd.conf at the bottom:
exec .1.3.6.1.4.1.14464.25 /usr/sbin/exim_perf.pl /bin/cat /etc/snmp/exim_perf.stats

If I do a snmpwalk on the spam stats I get this all the time:
SNMPv2-SMI::enterprises.14464.25.101.8 = STRING: "0"

Anyone any idea what I am doing wrong???
Linuxfreak_be
Posts: 22
Joined: Sun Sep 04, 2005 3:30 am
Location: Belgium

Post by Linuxfreak_be »

hi,

I've installed this.The graph is there but it always stays on 0.When running exim_perf.pl on the shell it runs correctly (no errors returned) but it always displays 0 for the values ....

System:fedora core 5
cpanel /whm
Exim & MailScanner
Attachments
exim.png
exim.png (17.81 KiB) Viewed 57560 times
iYRe
Posts: 40
Joined: Mon May 07, 2007 4:49 pm
Location: Auckland NZ
Contact:

Post by iYRe »

you might want to make sure the path to the log file is the right one.. for example, exim on my MX's logs to /var/log/mail.log, but the .pl script says /var/log/exim/mainlog.log
User avatar
KiaN
Posts: 12
Joined: Wed May 04, 2005 6:25 am
Location: Paris, France
Contact:

Post by KiaN »

Same problem here, and the path is correct.
Attachments
Exim
Exim
graph_image.png (33.13 KiB) Viewed 54281 times
http://www.kianouch.com
My pictures ^^
iYRe
Posts: 40
Joined: Mon May 07, 2007 4:49 pm
Location: Auckland NZ
Contact:

Post by iYRe »

hmm weird, i still cant get mine to work either...
If a man is in a forest, and he speaks to a tree and no woman can hear....

[i]is he still wrong?[/i]
User avatar
dk10tlx
Posts: 19
Joined: Sat Aug 04, 2007 8:10 am
Location: Tirol / Austria
Contact:

Post by dk10tlx »

Hi,

I've tried to modify the script to fit the output/mainlog for Exim4 on a Debian box, using vexim2.

Therefor I use the following routers and transports:
remote_smtp
virtual_delivery
virtual_vacation_delivery
ditch_spam_transport
ditch_spam_drop

Also I'd like to stat the rejected ones. So I modified the Script accordingly, but I get strange errors, when I execute it. Now I think about a way to rewrite it, maybe in PHP, but i don't really know, if or how to do it. Is there someone else using cacti to graph a mailserver using exim4/vexim2? Maybe we could find a solution togehter.

regards
Daniel
User avatar
dk10tlx
Posts: 19
Joined: Sat Aug 04, 2007 8:10 am
Location: Tirol / Austria
Contact:

Post by dk10tlx »

:D vexim2 and exim4 works now perfectly for me
Attachments
cacti_graph_template_exim_delivery_statistics.xml
(38.29 KiB) Downloaded 1524 times
cacti_data_template_exim4_blackhole.xml
(6.52 KiB) Downloaded 1245 times
cacti_data_template_exim4_ditch_spam_transport.xml
(6.54 KiB) Downloaded 1404 times
cacti_data_template_exim4_local_delivery.xml
(6.53 KiB) Downloaded 1369 times
cacti_data_template_exim4_mailman.xml
(6.51 KiB) Downloaded 1400 times
regards
Daniel

[size=67]
[b]cacti [color=red]0.8.6j[/color] - cactid [color=red]0.8.6i[/color]
Debian GNU/Linux lenny/sid[/b]
Apache2 - PHP5 - MySQL5[/size]
User avatar
dk10tlx
Posts: 19
Joined: Sat Aug 04, 2007 8:10 am
Location: Tirol / Austria
Contact:

Post by dk10tlx »

and some more xml's
Attachments
cacti_data_template_exim4_remote_smtp.xml
(6.52 KiB) Downloaded 1319 times
cacti_data_template_exim4_virtual_delivery.xml
(6.53 KiB) Downloaded 1194 times
cacti_data_template_exim4_virtual_vacation_delivery.xml
(6.54 KiB) Downloaded 1246 times
regards
Daniel

[size=67]
[b]cacti [color=red]0.8.6j[/color] - cactid [color=red]0.8.6i[/color]
Debian GNU/Linux lenny/sid[/b]
Apache2 - PHP5 - MySQL5[/size]
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests