Postfix monitoring with David Schweikert's Mailgraph?

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

Moderators: Developers, Moderators

Post Reply
User avatar
Instigater
Cacti User
Posts: 141
Joined: Mon Dec 13, 2004 5:14 pm
Location: Jurmala, Latvia

Post by Instigater »

Earl_Mobilee
Posts: 1
Joined: Thu Feb 02, 2006 12:35 pm

Post by Earl_Mobilee »

Hello everybody,

I work with cacti too. bit I can't it at a mailserver.
I can't always use cgi and snmp.

So how can I use postfix+mailgraph?

mailgraph.pl has created the rrd. But I can't they evaluate.

regards torsten
jmeyerdo
Posts: 26
Joined: Mon May 02, 2005 7:11 am
Location: Dortmund, Germany

Post by jmeyerdo »

After running cacti for "standard"-tasks since several weeks I am trying to use this great tool for some more special tasks for a small private project of mine. Unfortunately there are some small problems...

I installed files from "Rübenrotze" (page 2 in this thread) and followed his short installation-guide.
mailgraph is running fine - so the files /var/tmp/mail* are changing regularly.

But the graph is still empty/zero.
In debug-mode I can see the following message (for every mail-count: sent, recv, ...):

Code: Select all

02/15/2006 10:20:03 PM - CMDPHP: Poller[0] Host[3] DS[54] WARNING: Result from SNMP not valid.  Partial Result:
02/15/2006 10:20:03 PM - CMDPHP: Poller[0] Host[3] DS[54] SNMP: v1: server.hooge.ejeb.de, dsname: bounced, oid: , output: U
02/15/2006 10:20:03 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "insert into poller_output (local_data_id,rrd_name,time,output) values (54,'bounced','2006-02-15 22:20:02','U')"
I think, the output "U" is not correct.
But where could be the error for this behaviour?

Thank you for your hint,
kind regards, Jens
Giorgio
Posts: 21
Joined: Wed Jun 21, 2006 3:28 am

Post by Giorgio »

Hi guys,

Before beginning i want to apologize for my poor english.

I have a big problem with postfix- mailgraph so i hope that you'll help me.

So i follow the "HOW TO" to install mailgraph. Everything works. My cacti's request works too. i don't have any problem in my cacti server but the information that mailgraph gathers aren't good.

I have to manage postfix in a server on production (Trustix 2.2). So i decide, to test it in an environment test.

Cacti is install on a Fedora Core 4 and mailgraph - postfix host on a Fedora Core 4 too

- Fedora Core 4
- cacti 0.8h
- perl 5-8-6
- net-snmp 5-2-1
- rrdtool 1-2-11
- mailgraph ( i suppose version 1-4 according to the mailgraph-init file)

To test mailgraph i edit manually the log file /var/log/maillog i insert some lines with the status "sent" and "bounced".

The problem is that when i collect informations the number of this specific status aren't accurate.

When i look in the file /var/tmp/mailbounced (etc) i notice the number increase and after decrease just 1 seconde after etc.. and the numbers aren't good.

I have no problem when i start mailgraph by /etc/ini.d/mailgraph start:

[root@test bin]# /etc/init.d/mailgraph start
Starting mail statistics grapher: mailgraph


but when i try to launch mailgraph script by /usr/bin/mailgraph i have 1 error.

[root@test bin]# mailgraph
Error opening /var/log/syslog: Aucun fichier ou répertoire de ce type at /usr/bin/mailgraph line 299


I don't have this file.


Any idea?
scubabri
Posts: 32
Joined: Thu Jul 13, 2006 3:11 pm

multiple postfix graphs per host

Post by scubabri »

I want to be able to split up rejected and sent/recieved into two seperate graphs.

I create the graphs and then deselect the graph item fields for the stuff I don't want.

The graphs are never generated, anyone else having this problem, or am I doing something wrong.

I'd like them seperate because we reject about 2000 mails per interval

sb
jpingle
Posts: 37
Joined: Mon May 09, 2005 4:08 pm

Post by jpingle »

It's probably not getting any data because the numbers reset once they are read. There are a couple solutions, though:

Option 1: Clone the graph template and make one without the rejected values, and one with only the rejected values.
Create the first graph as normal with the 'non-rejected' graph template, and then when it comes time to add the second graph, don't add it as usual - Add it from the 'graph management' screen by clicking Add, and then select the data source created by the first graph, and the rejected-only template. This should make sure the data is only gathered once, and they all pull from the same data source.

Option 2 (What I do): Switch the graph type to use Logarithmic Auto Scaling, that way the high values for rejected don't have as much impact, and it's still easy to read once you get used to how the graph values are represented on the graph -- 1-10, 11-100, 101-1000, 1001-10000 etc.
scubabri
Posts: 32
Joined: Thu Jul 13, 2006 3:11 pm

Post by scubabri »

Thanks, option 2 works for me.

sb
mheyboer
Posts: 1
Joined: Thu Aug 03, 2006 9:42 am

Re: Cacti Mailgraph totals

Post by mheyboer »

I am using jpingle's mailgraph template for Cacti, and it is working great. I would like to add the ability (in addition to average and current) a 'total' - which keeps track of all reject/spam/bounce/viruses received during that 24 hour period. How can this be done? I know its possible as the rrdgraph has the total in and total out values right on the graph. Any suggestions??
kokkers
Posts: 16
Joined: Thu Feb 16, 2006 6:00 am

Re: Cacti Mailgraph totals

Post by kokkers »

mheyboer wrote:I am using jpingle's mailgraph template for Cacti, and it is working great. I would like to add the ability (in addition to average and current) a 'total' - which keeps track of all reject/spam/bounce/viruses received during that 24 hour period. How can this be done? I know its possible as the rrdgraph has the total in and total out values right on the graph. Any suggestions??
Mheyboer, I think you'll have to add a new line to the graph template and fiddle with the CDEF (math) functions a bit.
(Totall all data sources function for example)

I was hoping 'jpingle' still hangs out here or somebody else who can help me.

I am trying to read and graph Postfix stats from a remote server through SNMP. I was able to set up jpingle's scripts just fine but I get stuck on the Cacti side.

After adding the necessary templates to cacti and creating the graph after a polling cycle the graph and RRD are created.

However, no data gets inserted into the .RRD.

Cacti.log shows:

09/12/2006 01:40:20 PM - CACTID: Poller[0] Host[19] ERROR: Empty result [192.168.1.2]: '/usr/bin/perl /var/www/cacti/scripts/postfixcheck.pl 192.168.1.2'
09/12/2006 01:40:20 PM - CACTID: Poller[0] Host[19] DS[2692] WARNING: Result from SCRIPT not valid. Partial Result: ...

On my graphing server I can run the postfixcheck.pl script without any problems. It'll read the SNMP data and output the correct string:

'/usr/bin/perl /var/www/cacti/scripts/postfixcheck.pl 192.168.1.2' returns:

sent:270 received:313 bounced:4 rejected:89 spam:268 virus:11


The command listed in Cacti log as failed runs okay when copy/pasted to the commandline.

Data source debug:

Data Source Debug
/usr/local/rrd/bin/rrdtool create \
/var/www/cacti/rra/smtp1_virus_2692.rrd \
--step 300 \
DS:bounced:GAUGE:600:0:1000000 \
DS:sent:GAUGE:600:0:1000000 \
DS:virus:GAUGE:600:0:1000000 \
DS:received:GAUGE:600:0:1000000 \
DS:reject:GAUGE:600:0:1000000 \
DS:spam:GAUGE:600:0:1000000 \
RRA:AVERAGE:0.5:1:600 \
RRA:AVERAGE:0.5:6:700 \
RRA:AVERAGE:0.5:24:775 \
RRA:AVERAGE:0.5:288:797 \
RRA:MAX:0.5:1:600 \
RRA:MAX:0.5:6:700 \
RRA:MAX:0.5:24:775 \
RRA:MAX:0.5:288:797 \
RRA:LAST:0.5:1:600 \
RRA:LAST:0.5:6:700 \
RRA:LAST:0.5:24:775 \
RRA:LAST:0.5:288:797 \

From what I understand Cacti should parse this string in the output of the script and store them in the RRD I mentioned above.

sent:270 received:313 bounced:4 rejected:89 spam:268 virus:11

What more could I check?
I dont have much experience with input scripts but I am ready to pull my hair out :-).

Any help is appreciated.
vchouet
Posts: 4
Joined: Wed Dec 12, 2007 8:31 am

Same Problem : No graph !

Post by vchouet »

Hy,

Iv'e got the same problem.
Do you have any Idea ?

Thanks a lot.

Vincent
Tolien
Posts: 4
Joined: Tue May 31, 2005 5:05 pm

Re: Cacti Mailgraph totals

Post by Tolien »

mheyboer wrote:I am using jpingle's mailgraph template for Cacti, and it is working great. I would like to add the ability (in addition to average and current) a 'total' - which keeps track of all reject/spam/bounce/viruses received during that 24 hour period. How can this be done? I know its possible as the rrdgraph has the total in and total out values right on the graph. Any suggestions??
The best I've got so far is to create a comment, with "Total: |sum:0:current:4:auto|". The problem is that it gives values that are too big (by about a factor of 300).
tyson
Posts: 4
Joined: Fri Mar 14, 2008 10:17 am

Post by tyson »

I understand that this thread is quite old, but it's information still appears very valid...

Unfortunately, I am trying to follow the instructions presented here, however I am unable to get the local snmpd to respond with the correct values from mailgraph.

I can see that the daemon is properly running and returning values to the /var/tmp directory, however when I try to query those values from /var/tmp, I constantly get an error:

WARNING: Result from SNMP not valid. Partial Result: No Such Object avail

When I query the SNMP Trap directly, I get the following...
UCD-SNMP-MIB::extOutput.8 = No more variables left in this MIB View (It is past the end of the MIB tree)

I assume that this is something that I have entered incorrectly into my /etc/snmp/snmp.conf file, however I followed the instructions presented exactly, and they stated to simply add the following line to this file.

exec mailcount /usr/bin/postfixstats.sh

Could someone please assist me to get this system working?
Thank you very much for your assistance.

~Tyson Edwards
Number
Posts: 6
Joined: Thu Aug 21, 2008 3:19 am

Post by Number »

I'm really don't understand, i have all my graph working (process,mem,ping,...)

I have add without problem ws_apache_stats and they work..

But when i try to add a graph for postfix, i always have the same error :
RRDTool Says:

ERROR: opening '/var/www/cacti/rra/soez_be_virus_39.rrd': No such file or directory
Why ?? When i add apache, they work, but never for postfix, where is the problem?

I test with Pingle template, and everything work (postfixstats.pl work, mailgraph work..)
But, cacti never créate rrd file..

Why ?

Thanks for your help and to any reply..
i'm sorry, i'm a french, and i'm speak better french ...
User avatar
rsuinux
Posts: 9
Joined: Mon Oct 06, 2008 3:19 am
Location: Orion Galaxy
Contact:

correction for debian user

Post by rsuinux »

hello all
(sorry for my very poor english)
I use mailgraph, and i modified the initscript mailgrph for use in my debian stable

http://linuxette.suinot.org/tmp/mailgraph

And, in the parameter for mailgraph, the log file is not
/var/log/maillog
but
/var/log/mail.log
fitzb0z0
Posts: 1
Joined: Tue Oct 14, 2008 4:58 pm

mailgraph.pl not updating

Post by fitzb0z0 »

Hi All,

I am using the modified mailgraph.pl that updates files in /var/tmp instead of updated the rrd files.

I start mailgraph with the init script and it updates the files as expected.

[someuser@somebox /var/tmp] /usr/local/bin/postfixstats.sh
sent:400 received:334 bounced:21 rejected:299 spam:138 virus:0

Then cacti comes long and runs postfixstats.sh via snmpd, which works fine and zeros out the files in /var/tmp.

The problem is the files are never updated again by mailgraph.pl even though the daemon continues to run.

Anyone else experience this behavior?

Thanks,
Sean
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests