|
|
| Author |
Message |
nduda78 Cacti User
Joined: 01 Mar 2005 Posts: 106
|
Posted: Wed Mar 02, 2005 2:29 pm Post subject: Walkthrough on Postifx monitoring with Cacti |
|
|
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
|
|
| Back to top |
|
 |
Instigater Cacti User
Joined: 13 Dec 2004 Posts: 94 Location: Jurmala, Latvia
|
Posted: Thu Dec 15, 2005 9:24 am Post subject: |
|
|
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.
|
|
| Back to top |
|
 |
gandalf Developer
Joined: 02 Dec 2004 Posts: 12295 Location: Muenster, Germany
|
Posted: Fri Dec 16, 2005 12:39 pm Post subject: |
|
|
Moved to Scripts and Templates
Reinhard
|
|
| Back to top |
|
 |
Instigater Cacti User
Joined: 13 Dec 2004 Posts: 94 Location: Jurmala, Latvia
|
Posted: Mon Dec 19, 2005 3:40 am Post subject: |
|
|
| Almost done, found some bugs, fixing and testing right away.
|
|
| Back to top |
|
 |
Instigater Cacti User
Joined: 13 Dec 2004 Posts: 94 Location: Jurmala, Latvia
|
|
| Back to top |
|
 |
typera
Joined: 02 Jan 2006 Posts: 1
|
Posted: Mon Jan 02, 2006 1:20 pm Post subject: |
|
|
| Instigater wrote: | Fixed, tested, looks nice and right
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
|
|
| Back to top |
|
 |
epoch
Joined: 18 Jan 2006 Posts: 2
|
Posted: Wed Jan 18, 2006 4:53 pm Post subject: error when importing xml template |
|
|
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!
|
|
| Back to top |
|
 |
davidwoo
Joined: 07 Oct 2005 Posts: 7
|
Posted: Thu Jan 26, 2006 10:43 pm Post subject: |
|
|
Dear typera
Can you create one item? DISCARD
Thank you so much.
|
|
| Back to top |
|
 |
epoch
Joined: 18 Jan 2006 Posts: 2
|
Posted: Wed Feb 01, 2006 4:33 pm Post subject: Re: error when importing xml template |
|
|
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! |
|
|
| Back to top |
|
 |
rfuller
Joined: 03 Feb 2006 Posts: 5
|
Posted: Thu Feb 09, 2006 1:38 pm Post subject: |
|
|
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); };
|
|
| Back to top |
|
 |
francismcphail
Joined: 10 May 2004 Posts: 2
|
Posted: Sun Feb 12, 2006 11:16 pm Post subject: |
|
|
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
|
|
|
| Back to top |
|
 |
Instigater Cacti User
Joined: 13 Dec 2004 Posts: 94 Location: Jurmala, Latvia
|
Posted: Mon Feb 13, 2006 8:58 am Post subject: |
|
|
Did you configure SNMP agent on mailserver?
Does perl script have right permisions?
|
|
| Back to top |
|
 |
Instigater Cacti User
Joined: 13 Dec 2004 Posts: 94 Location: Jurmala, Latvia
|
Posted: Mon Feb 13, 2006 9:00 am Post subject: Re: error when importing xml template |
|
|
| 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.
|
|
| Back to top |
|
 |
kharford
Joined: 07 Jul 2005 Posts: 40 Location: Mass, USA
|
Posted: Wed Feb 15, 2006 2:36 pm Post subject: Any Ideas?? |
|
|
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
| Description: |
|
| Filesize: |
82 KB |
| Viewed: |
43297 Time(s) |

|
|
|
| Back to top |
|
 |
vinx
Joined: 06 Mar 2006 Posts: 18
|
Posted: Mon Mar 06, 2006 12:05 pm Post subject: |
|
|
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.
|
|
| Back to top |
|
 |
|