Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Tue Jul 23, 2019 6:17 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 85 posts ]  Go to page 1, 2, 3, 4, 5, 6  Next
Author Message
 Post subject: Walkthrough on Postifx monitoring with Cacti
PostPosted: Wed Mar 02, 2005 2:29 pm 
Offline
Cacti User

Joined: Tue Mar 01, 2005 11:26 am
Posts: 106
Can someone post a step by step walk through on getting Postfix info (over SNMP perhaps?) to a cacti server and graph it. This should be for recieved, sent, bounced....etc

A search on the forums and google/news gives nothing on how to accompkish this in a step by step.

Thanks,
Nick


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 15, 2005 9:24 am 
Offline
Cacti User
User avatar

Joined: Mon Dec 13, 2004 5:14 pm
Posts: 141
Location: Jurmala, Latvia
I could make templates but I don't know which OIDs should be used better. I made script that reports:
received
sent
clean
viruses
bounced
deffered
rejected
through SNMP. I don't know which would be the best place to mount this data in SNMP tree that does not conflict with other data.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 16, 2005 12:39 pm 
Offline
Developer
User avatar

Joined: Thu Dec 02, 2004 2:46 am
Posts: 22376
Location: Muenster, Germany
Moved to Scripts and Templates
Reinhard


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 19, 2005 3:40 am 
Offline
Cacti User
User avatar

Joined: Mon Dec 13, 2004 5:14 pm
Posts: 141
Location: Jurmala, Latvia
Almost done, found some bugs, fixing and testing right away.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 19, 2005 8:22 am 
Offline
Cacti User
User avatar

Joined: Mon Dec 13, 2004 5:14 pm
Posts: 141
Location: Jurmala, Latvia
Fixed, tested, looks nice and right :D

Installation:
1) Configure SNMP agent on Mail server and make sure it is set up right.
2) Unzip fetch_mail_statistics.pl script in place of your choice. (I used /usr/local/bin)
3) Check that your perl path in script points to perl executable
4) Add following line in snmpd.conf file
Code:
pass .1.3.6.1.4.1.2021.255 /usr/local/bin/fetch_mail_statistics.pl /var/log/mail.log /var/log/mailstats.db .1.3.6.1.4.1.2021.255

5) Adjust your maillog filename and path corresponding to your system. mailstats.db are used for internal script data storage, place it anywhere.
6) Import template in cacti.

Script proudly stolen from
http://netilium.org/~mad/technotes/postfixstat/
some code ideas inspired from
http://people.ee.ethz.ch/~dws/software/mailgraph/

NB! Script is based on one minute polling interval, adjustments must be made to run on default Cacti installation. This template also updates Yearly (1 day average) RRA, so be careful.


Attachments:
File comment: Download this, the first one had some bugs in perl.
postfix_mailserver.tar.gz [7.11 KiB]
Downloaded 10824 times


Last edited by Instigater on Mon Jun 19, 2006 7:32 am, edited 1 time in total.
Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 02, 2006 1:20 pm 
Offline

Joined: Mon Jan 02, 2006 1:18 pm
Posts: 1
Instigater wrote:
Fixed, tested, looks nice and right :D

Installation:
1) Configure SNMP agent on Mail server and make sure it is set up right.
2) Unzip fetch_mail_statistics.pl script in place of your choice. (I used /usr/local/bin)
3) Check that your perl path in script points to perl executable
4) Add following line in snmpd.conf file
Code:
pass .1.3.6.1.4.1.2021.255 /usr/local/bin/fetch_mail_statistics.pl /var/log/mail.log /var/log/mailstats.db .1.3.6.1.4.1.2021.255

5) Adjust your maillog filename and path corresponding to your system. mailstats.db are used for internal script data storage, place it anywhere.
6) Import template in cacti.

Script proudly stolen from
http://netilium.org/~mad/technotes/postfixstat/
some code ideas inspired from
http://people.ee.ethz.ch/~dws/software/mailgraph/

NB! Script is based on one minute polling interval, adjustments must be made to run on default Cacti installation. This template also updates Yearly (1 day average) RRA, so be careful.

Hi Instigater,

thank you for posting this. As being a novice to the cacti/rrdtool could you please let me know what exactly I need to change to make this suitable for a 5 min refresh intervals. ?

Cheers,
Max


Top
 Profile  
 
 Post subject: error when importing xml template
PostPosted: Wed Jan 18, 2006 4:53 pm 
Offline

Joined: Wed Jan 18, 2006 11:58 am
Posts: 2
When trying to import cacti_host_template_postfix_mailserver.xml I get the following error:

Code:
Notice: Only variable references should be returned by reference in /var/www/localhost/htdocs/cacti/lib/import.php on line 44

Warning: Cannot modify header information - headers already sent by (output started at /var/www/localhost/htdocs/cacti/lib/import.php:44) in /var/www/localhost/htdocs/cacti/templates_import.php on line 67

Anyone have any ideas on what can be done to fix this? I am using cacti 0.8.6f on Gentoo.

Thanks Much!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 26, 2006 10:43 pm 
Offline

Joined: Fri Oct 07, 2005 12:42 pm
Posts: 7
Dear typera

Can you create one item? DISCARD

Thank you so much.


Top
 Profile  
 
 Post subject: Re: error when importing xml template
PostPosted: Wed Feb 01, 2006 4:33 pm 
Offline

Joined: Wed Jan 18, 2006 11:58 am
Posts: 2
I was able to get the template to import once I upgraded to the latest version of Cacti. I am now running into another issue. The postfix graphs do not seem to be updating properly. I get partial lines drawn for sent messages. Basically, the sent graph line will appear in segments across the graph. Anyone have any ideas as to why this is happening?

epoch wrote:
When trying to import cacti_host_template_postfix_mailserver.xml I get the following error:

Code:
Notice: Only variable references should be returned by reference in /var/www/localhost/htdocs/cacti/lib/import.php on line 44

Warning: Cannot modify header information - headers already sent by (output started at /var/www/localhost/htdocs/cacti/lib/import.php:44) in /var/www/localhost/htdocs/cacti/templates_import.php on line 67

Anyone have any ideas on what can be done to fix this? I am using cacti 0.8.6f on Gentoo.

Thanks Much!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 09, 2006 1:38 pm 
Offline

Joined: Fri Feb 03, 2006 12:42 pm
Posts: 5
EDIT: Never mind it was because I had amavis changed to do everything local and the script filters out localhost.

I had everything up and working great...then I installed syslog-ng and only filtering shows up now. Anyone have any ideas? using postfix/amavis/clamd/spamassassin.
Here is the maillog portion of my syslog-ng.conf:

destination d_mail { file("/var/log/maillog" sync(10)); };
source s_local { internal(); file("/proc/kmsg" log_prefix("kernel: ")); unix-dgram("/dev/log"); };
filter f_filter4 { facility(mail); };
log { source(s_local); filter(f_filter4); destination(d_mail); };


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 12, 2006 11:16 pm 
Offline

Joined: Mon May 10, 2004 1:21 am
Posts: 2
I've gone though the steps as listed above, and have the following error when I manually run the poller.

Anyone have any ideas?

Code:
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: .1.3.6.1.4.1.2021.255.3

Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: .1.3.6.1.4.1.2021.255.2

OK u:0.00 s:0.00 r:0.01
OK u:0.00 s:0.00 r:0.01
OK u:0.00 s:0.00 r:0.01
OK u:0.00 s:0.00 r:0.01
OK u:0.00 s:0.00 r:0.01
OK u:0.00 s:0.00 r:0.01
OK u:0.00 s:0.00 r:0.01
OK u:0.00 s:0.00 r:0.01
OK u:0.00 s:0.00 r:0.01
OK u:0.00 s:0.00 r:0.01
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: .1.3.6.1.4.1.2021.255.0

OK u:0.00 s:0.00 r:0.06
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: .1.3.6.1.4.1.2021.255.4

Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: .1.3.6.1.4.1.2021.255.1

Content-type: text/html
X-Powered-By: PHP/4.3.2

02/13/2006 03:12:50 PM - SYSTEM STATS: Time:2.1098 Method:cmd.php Processes:1 Threads:N/A Hosts:2 HostsPerProcess:2 DataSources:18 RRDsProcessed:14
OK u:0.00 s:0.00 r:1.08
OK u:0.00 s:0.00 r:1.08
OK u:0.00 s:0.00 r:1.08


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 13, 2006 8:58 am 
Offline
Cacti User
User avatar

Joined: Mon Dec 13, 2004 5:14 pm
Posts: 141
Location: Jurmala, Latvia
Did you configure SNMP agent on mailserver?
Does perl script have right permisions?


Top
 Profile  
 
 Post subject: Re: error when importing xml template
PostPosted: Mon Feb 13, 2006 9:00 am 
Offline
Cacti User
User avatar

Joined: Mon Dec 13, 2004 5:14 pm
Posts: 141
Location: Jurmala, Latvia
epoch wrote:
I was able to get the template to import once I upgraded to the latest version of Cacti. I am now running into another issue. The postfix graphs do not seem to be updating properly. I get partial lines drawn for sent messages. Basically, the sent graph line will appear in segments across the graph. Anyone have any ideas as to why this is happening?
...


Your mailserver is not busy enough. ;-) Only mailservers of ISPs or popular webmail servers will have enough mail traffic to generate lines.


Top
 Profile  
 
 Post subject: Any Ideas??
PostPosted: Wed Feb 15, 2006 2:36 pm 
Offline
Cacti User

Joined: Thu Jul 07, 2005 11:53 am
Posts: 50
Location: Mass, USA
I am having problems displaying data in Cacti for Postfix Mailstats.

I am using the fetch_mail_statistics.pl script and grabbing the data via SNMP. I am using a loghost to log all my postfix mail data. I am running the fetch script on the loghost.

Here is the output of my logfile:

02/15/2006 01:20:05 PM - CMDPHP: Poller[0] Host[2] DS[41] SNMP: v1: loghost3, dsname: postfix_sent, oid: .1.3.6.1.4.1.2021.255.1, output: 84004
02/15/2006 01:20:05 PM - CMDPHP: Poller[0] Host[2] DS[40] SNMP: v1: loghost3, dsname: postfix_reject, oid: .1.3.6.1.4.1.2021.255.4, output: 0
02/15/2006 01:20:05 PM - CMDPHP: Poller[0] Host[2] DS[39] SNMP: v1: loghost3, dsname: postfix_recv, oid: .1.3.6.1.4.1.2021.255.0, output: 0
02/15/2006 01:20:05 PM - CMDPHP: Poller[0] Host[2] DS[38] SNMP: v1: loghost3, dsname: postfix_deferred, oid: .1.3.6.1.4.1.2021.255.2, output: 14062
02/15/2006 01:20:05 PM - CMDPHP: Poller[0] Host[2] DS[37] SNMP: v1: loghost3, dsname: postfix_bounced, oid: .1.3.6.1.4.1.2021.255.3, output: 4076




This data never makes it to my graph.

Any ideas??

Ken


Attachments:
Mail-Stats.JPG
Mail-Stats.JPG [ 82 KiB | Viewed 103885 times ]
Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 06, 2006 12:05 pm 
Offline

Joined: Mon Mar 06, 2006 12:02 pm
Posts: 18
Hello,
I tried to import template but I got the following error:

Error: XML: Hash version does not exist

I run Cacti 0.8.6c on Debian Sarge.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 85 posts ]  Go to page 1, 2, 3, 4, 5, 6  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 7 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