Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Mon Jun 24, 2019 4:34 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 50 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
 Post subject: exim statistics
PostPosted: Tue May 17, 2005 7:43 pm 
Offline

Joined: Fri May 13, 2005 1:38 am
Posts: 13
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:
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 3866 times
Top
 Profile  
 
 Post subject:
PostPosted: Tue May 17, 2005 7:45 pm 
Offline

Joined: Fri May 13, 2005 1:38 am
Posts: 13
A prettier example :)


Attachments:
graph_image-1.png
graph_image-1.png [ 67.06 KiB | Viewed 52867 times ]
Top
 Profile  
 
 Post subject:
PostPosted: Tue May 17, 2005 7:49 pm 
Offline

Joined: Fri May 13, 2005 1:38 am
Posts: 13
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 2881 times
Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 15, 2005 8:41 am 
Offline

Joined: Tue Jan 18, 2005 7:50 am
Posts: 49
Excellent - thanks for that, I'll give them ago!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 24, 2005 4:10 am 
Offline

Joined: Thu Oct 27, 2005 9:24 am
Posts: 18
Location: Germany, Bavaria
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:
2005-11-24 07:38:56 1EfAky-0001hh-Fv <= [email protected] H=mforward.dtag.de [194.25.242.123] P=esmtp S=2385 [email protected] T="lowCostDrugs!" from <[email protected]> for [email protected]
2005-11-24 07:38:56 1EfAky-0001hh-Fv => :blackhole: <[email protected]> R=ditch_spam


Output of your Script after the modification:
Code:
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:
2005-11-24 07:05:16 H=mforward.dtag.de [194.25.242.123] F=<[email protected]> rejected RCPT <[email protected]>: Unknown user


Thanks 4 help!!
Hildebrand


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 11, 2006 4:48 pm 
Offline

Joined: Wed May 25, 2005 3:57 am
Posts: 39
ANyone had luck with these scripts? Ive setted everything up as request but no luck, graphs keep saying NAN.. but they d


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 18, 2006 9:34 am 
Offline

Joined: Thu Apr 06, 2006 4:28 pm
Posts: 9
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


Top
 Profile  
 
 Post subject: Cacti not updating
PostPosted: Fri Oct 27, 2006 1:07 am 
Offline

Joined: Fri Oct 27, 2006 1:03 am
Posts: 3
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???


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 05, 2006 2:07 pm 
Offline

Joined: Sun Sep 04, 2005 3:30 am
Posts: 22
Location: Belgium
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 49952 times ]
Top
 Profile  
 
 Post subject:
PostPosted: Sun May 13, 2007 9:57 pm 
Offline

Joined: Mon May 07, 2007 4:49 pm
Posts: 40
Location: Auckland NZ
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


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 11, 2007 11:37 am 
Offline
User avatar

Joined: Wed May 04, 2005 6:25 am
Posts: 12
Location: Paris, France
Same problem here, and the path is correct.


Attachments:
File comment: Exim
graph_image.png
graph_image.png [ 33.13 KiB | Viewed 46673 times ]

_________________
http://www.kianouch.com
My pictures ^^
Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 11, 2007 3:04 pm 
Offline

Joined: Mon May 07, 2007 4:49 pm
Posts: 40
Location: Auckland NZ
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....

is he still wrong?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 04, 2007 8:22 am 
Offline
User avatar

Joined: Sat Aug 04, 2007 8:10 am
Posts: 19
Location: Tirol / Austria
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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 07, 2007 4:44 pm 
Offline
User avatar

Joined: Sat Aug 04, 2007 8:10 am
Posts: 19
Location: Tirol / Austria
:D vexim2 and exim4 works now perfectly for me


Attachments:
cacti_data_template_exim4_mailman.xml [6.51 KiB]
Downloaded 1025 times
cacti_data_template_exim4_local_delivery.xml [6.53 KiB]
Downloaded 971 times
cacti_data_template_exim4_ditch_spam_transport.xml [6.54 KiB]
Downloaded 1025 times
cacti_data_template_exim4_blackhole.xml [6.52 KiB]
Downloaded 865 times
cacti_graph_template_exim_delivery_statistics.xml [38.29 KiB]
Downloaded 1103 times

_________________
regards
Daniel


cacti 0.8.6j - cactid 0.8.6i
Debian GNU/Linux lenny/sid

Apache2 - PHP5 - MySQL5
Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 07, 2007 4:45 pm 
Offline
User avatar

Joined: Sat Aug 04, 2007 8:10 am
Posts: 19
Location: Tirol / Austria
and some more xml's


Attachments:
cacti_data_template_exim4_virtual_vacation_delivery.xml [6.54 KiB]
Downloaded 843 times
cacti_data_template_exim4_virtual_delivery.xml [6.53 KiB]
Downloaded 828 times
cacti_data_template_exim4_remote_smtp.xml [6.52 KiB]
Downloaded 926 times

_________________
regards
Daniel


cacti 0.8.6j - cactid 0.8.6i
Debian GNU/Linux lenny/sid

Apache2 - PHP5 - MySQL5
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 50 posts ]  Go to page 1, 2, 3, 4  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group