Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


exim statistics
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates
Author Message
chrome



Joined: 13 May 2005
Posts: 13

PostPosted: Tue May 17, 2005 7:43 pm    Post subject: exim statistics Reply with quote

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.



exim_perf.pl.zip
 Description:

Download
 Filename:  exim_perf.pl.zip
 Filesize:  1.23 KB
 Downloaded:  1907 Time(s)

Back to top
chrome



Joined: 13 May 2005
Posts: 13

PostPosted: Tue May 17, 2005 7:45 pm    Post subject: Reply with quote

A prettier example


graph_image-1.png
 Description:
 Filesize:  67.06 KB
 Viewed:  16859 Time(s)

graph_image-1.png


Back to top
chrome



Joined: 13 May 2005
Posts: 13

PostPosted: Tue May 17, 2005 7:49 pm    Post subject: Reply with quote

Here is the graph template with dependencies ... i have no idea if any of this will work if you just throw it in.


cacti_graph_template_exim_delivery_statistics.xml
 Description:

Download
 Filename:  cacti_graph_template_exim_delivery_statistics.xml
 Filesize:  37.45 KB
 Downloaded:  1346 Time(s)

Back to top
Paul Thexton



Joined: 18 Jan 2005
Posts: 49

PostPosted: Fri Jul 15, 2005 8:41 am    Post subject: Reply with quote

Excellent - thanks for that, I'll give them ago!
Back to top
Hildebrand



Joined: 27 Oct 2005
Posts: 14
Location: Germany, Bavaria

PostPosted: Thu Nov 24, 2005 4:10 am    Post subject: Reply with quote

Thanks for this Script!

I must modified the Transporters in your Script and don´t know how!?
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 <= 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:

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=<Downloads@BKA.de> rejected RCPT <6.00.2900.2180katarzyna@mydomain.tdl>: Unknown user


Thanks 4 help!!
Hildebrand
Back to top
aleto



Joined: 25 May 2005
Posts: 37

PostPosted: Sun Jun 11, 2006 4:48 pm    Post subject: Reply with quote

ANyone had luck with these scripts? Ive setted everything up as request but no luck, graphs keep saying NAN.. but they d
Back to top
umbroboy



Joined: 06 Apr 2006
Posts: 9

PostPosted: Fri Aug 18, 2006 9:34 am    Post subject: Reply with quote

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
Back to top
Overflower



Joined: 27 Oct 2006
Posts: 1

PostPosted: Fri Oct 27, 2006 1:07 am    Post subject: Cacti not updating Reply with quote

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???
Back to top
Linuxfreak_be



Joined: 04 Sep 2005
Posts: 22
Location: Belgium

PostPosted: Sun Nov 05, 2006 2:07 pm    Post subject: Reply with quote

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



exim.png
 Description:
 Filesize:  17.81 KB
 Viewed:  13944 Time(s)

exim.png


Back to top
iYRe



Joined: 07 May 2007
Posts: 35
Location: Auckland NZ

PostPosted: Sun May 13, 2007 9:57 pm    Post subject: Reply with quote

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
Back to top
KiaN



Joined: 04 May 2005
Posts: 12
Location: Paris, France

PostPosted: Wed Jul 11, 2007 11:37 am    Post subject: Reply with quote

Same problem here, and the path is correct.


graph_image.png
 Description:
Exim
 Filesize:  33.13 KB
 Viewed:  10665 Time(s)

graph_image.png


Back to top
iYRe



Joined: 07 May 2007
Posts: 35
Location: Auckland NZ

PostPosted: Wed Jul 11, 2007 3:04 pm    Post subject: Reply with quote

hmm weird, i still cant get mine to work either...
Back to top
dk10tlx



Joined: 04 Aug 2007
Posts: 19
Location: Tirol / Austria

PostPosted: Sat Aug 04, 2007 8:22 am    Post subject: Reply with quote

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
Back to top
dk10tlx



Joined: 04 Aug 2007
Posts: 19
Location: Tirol / Austria

PostPosted: Tue Aug 07, 2007 4:44 pm    Post subject: Reply with quote

vexim2 and exim4 works now perfectly for me


cacti_data_template_exim4_mailman.xml
 Description:

Download
 Filename:  cacti_data_template_exim4_mailman.xml
 Filesize:  6.51 KB
 Downloaded:  257 Time(s)


cacti_data_template_exim4_local_delivery.xml
 Description:

Download
 Filename:  cacti_data_template_exim4_local_delivery.xml
 Filesize:  6.53 KB
 Downloaded:  217 Time(s)


cacti_data_template_exim4_ditch_spam_transport.xml
 Description:

Download
 Filename:  cacti_data_template_exim4_ditch_spam_transport.xml
 Filesize:  6.54 KB
 Downloaded:  175 Time(s)


cacti_data_template_exim4_blackhole.xml
 Description:

Download
 Filename:  cacti_data_template_exim4_blackhole.xml
 Filesize:  6.52 KB
 Downloaded:  183 Time(s)


cacti_graph_template_exim_delivery_statistics.xml
 Description:

Download
 Filename:  cacti_graph_template_exim_delivery_statistics.xml
 Filesize:  38.29 KB
 Downloaded:  263 Time(s)

Back to top
dk10tlx



Joined: 04 Aug 2007
Posts: 19
Location: Tirol / Austria

PostPosted: Tue Aug 07, 2007 4:45 pm    Post subject: Reply with quote

and some more xml's


cacti_data_template_exim4_virtual_vacation_delivery.xml
 Description:

Download
 Filename:  cacti_data_template_exim4_virtual_vacation_delivery.xml
 Filesize:  6.54 KB
 Downloaded:  181 Time(s)


cacti_data_template_exim4_virtual_delivery.xml
 Description:

Download
 Filename:  cacti_data_template_exim4_virtual_delivery.xml
 Filesize:  6.53 KB
 Downloaded:  168 Time(s)


cacti_data_template_exim4_remote_smtp.xml
 Description:

Download
 Filename:  cacti_data_template_exim4_remote_smtp.xml
 Filesize:  6.52 KB
 Downloaded:  199 Time(s)

Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates All times are GMT - 5 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 



Powered by phpBB © 2001, 2005 phpBB Group