Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support
It is currently Mon May 21, 2012 8:25 am


ATTENTION: All users passwords have been cleared.
Please use the "Forgot Password" feature to reset your password.


All times are UTC - 5 hours




Post new topic Reply to topic  [ 108 posts ]  Go to page Previous  1, 2, 3, 4, 5 ... 8  Next
Author Message
 Post subject:
PostPosted: Mon Apr 12, 2004 10:24 am 
Offline

Joined: Thu Apr 08, 2004 1:06 pm
Posts: 10
Well i did some small changes after i posted also. But the big work that sucks is in the templates *G*

I changed the Data Source Type to ABSOLUTE because i dont saw that
before.

The OID is a problem but not if you install it stricly like it was said in the manual and put the exec for them on top of the snmpd.

Greetings
Enforcer
PS: my first work with cacti and i would also not make one datasource for each input anymore - well it works *G*


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 02, 2004 6:48 am 
Offline
User avatar

Joined: Mon Dec 29, 2003 5:25 pm
Posts: 12
Location: Poland, Gdynia
what version do you have ?
Mine is 0.8.4 and cannot use your template.... :(

Just do an import, and nothing happens. Could not find 'Postfix Stats'...


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 02, 2004 10:20 am 
Offline
Cacti User

Joined: Wed Jan 07, 2004 11:16 am
Posts: 84
hi there,

i installed the template "cacti_graph_template_postfix_stats.xml", but the graph generates NaN.
Data Source Debug shows:

/usr/local/bin/rrdtool create \
/var/www/htdocs/cacti-0.8.5a/rra/office_postfixstats_recv_952.rrd \
--step 300 \
DS:recv:GAUGE:600:0:1000 \
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 \

i see, on the machine the postfix is installed on, snmprequests for the oids of the sent, recv, bounce, etc. btu it seems as if no data is returned, or that the postfix does not have these mibs - is that possible?
also, where does the mailgraph.pl script comes into play here?

--harel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 03, 2004 4:35 am 
Offline

Joined: Wed Sep 01, 2004 3:58 am
Posts: 18
Hi,

i have 2 questions:

I import the xml template and unzipzd the mailgraph.pl.gz script in the cacti/scripts/ directory.

1. Now i'd like to know if i need to add in the DATA INPUT METHODS the following line :

perl <cacti path> /scripts/mailgraph.pl ??


2. what's more, do this scripts allow me to get postifx information of a remote linux machine or only from the localhost (which run cacti and this perl sciprt) ??

thanks a lot


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 28, 2005 9:04 pm 
Offline
Cacti User
User avatar

Joined: Tue Aug 24, 2004 5:02 pm
Posts: 366
Location: San Francisco, CA
Ok, having an issue with this... Had to change the snmpd.conf, since I already have things responding on those oids.. so my snmpd.conf looks like:

Code:
exec 1.3.6.1.4.1.2021.8.2.101.1 mailcount_sent /bin/cat /var/tmp/mailsent
exec 1.3.6.1.4.1.2021.8.2.101.2 mailcount_recv /bin/cat /var/tmp/mailrecv
exec 1.3.6.1.4.1.2021.8.2.101.3 mailcount_reject /bin/cat /var/tmp/mailrejected
exec 1.3.6.1.4.1.2021.8.2.101.4 mailcount_bounced /bin/cat /var/tmp/mailbounced
exec 1.3.6.1.4.1.2021.8.2.101.5 mailcount_spam /bin/cat /var/tmp/mailspam
exec 1.3.6.1.4.1.2021.8.2.101.6 mailcount_virus /bin/cat /var/tmp/mailvirus

I changed the data templates to match...

sent oid is: .1.3.6.1.4.1.2021.8.2.101.1
etc...

I can snmpwalk the oids, and I get:
# snmpwalk -v 2c -c xxxxx mail01 1.3.6.1.4.1.2021.8.2.101.1
UCD-SNMP-MIB::extTable.2.101.1.1.1 = INTEGER: 1
UCD-SNMP-MIB::extTable.2.101.1.2.1 = STRING: "mailcount_sent"
UCD-SNMP-MIB::extTable.2.101.1.3.1 = STRING: "/bin/cat /var/tmp/mailsent"
UCD-SNMP-MIB::extTable.2.101.1.100.1 = INTEGER: 0
UCD-SNMP-MIB::extTable.2.101.1.101.1 = STRING: "16"
UCD-SNMP-MIB::extTable.2.101.1.102.1 = INTEGER: 0


Which looks right... But cacti's not graphing anything.

in the logs I get:
01/28/2005 05:46:18 PM - CMDPHP: Poller[0] Host[47] SNMP: v2: mail00.avantgo.com, dsname: send, oid: .1.3.6.1.4.1.2021.8.2.101.1, output: U

Any ideas?

_________________
FreeBSD 6.3/Linux 2.6
cacti-0.8.7g, spine 0.8.7g, boost 4.3
mysql 5.1/InnoDB
RRDtool 1.4.3
PHP 5.3.3


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 31, 2005 2:33 pm 
Offline
Cacti User
User avatar

Joined: Tue Aug 24, 2004 5:02 pm
Posts: 366
Location: San Francisco, CA
Ok, fixed it. was a premissions issue for the cron job.

_________________
FreeBSD 6.3/Linux 2.6
cacti-0.8.7g, spine 0.8.7g, boost 4.3
mysql 5.1/InnoDB
RRDtool 1.4.3
PHP 5.3.3


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 02, 2005 12:03 pm 
Offline
Cacti User

Joined: Tue Mar 01, 2005 11:26 am
Posts: 106
> That templates are working if you have the exec stuff in the snmpd at > the top or the postfix stats entry’s are the only one.

Can you explain what i need to add to my snmpd.conf file for this to work. I've imported the templates already.

- Nick


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 29, 2005 11:09 am 
Offline

Joined: Mon Mar 21, 2005 8:52 am
Posts: 27
I'd be very interesting in tying in postfix into my (new) Cacti setup, I was wondering whwere I could get the latest versions of
- the XML file
- the perl script
- snmp.conf
and a few tips on setting it up?
I was also wondering about using snmp to get the stuff. For my environment it would probalby have been just as easy to create the rrd file on the postfix box, and copy via ssh to the Cacti box, from where it would be imported into cacti & displayed. Has anyone tried an alternative like this?
Finally I was wondering if anyone has integrated postgrey log analysis?

Regards,

_________________
Sean


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 06, 2005 2:14 pm 
Offline

Joined: Wed Apr 06, 2005 1:57 pm
Posts: 2
Hi, i think i have a little Problem with the script.

With starting i get a failure:
Use of uninitialized value in numeric eq (==) at ... line 588
Use of uninitialized value in numeric lt (<) at ... line 589

and the counters for send, recived and spam in the textfiles are not set back to 0, so the
graph shows always a line climbing up.


Attachments:
File comment: the cacti imported goes not back to 0
graph_image.php.png
graph_image.php.png [ 6 KiB | Viewed 26031 times ]
File comment: the original graph goes to 0 if no mail comes in
mailgraph.cgi.png
mailgraph.cgi.png [ 5.58 KiB | Viewed 26031 times ]
Top
 Profile  
 
 Post subject:
PostPosted: Mon May 02, 2005 7:36 pm 
Offline

Joined: Mon May 02, 2005 7:18 pm
Posts: 6
1. failure when starting mailgraph:
solution: modify the latest version of mailgraph.

2. graph not set back to 0:
solution: after polling set /var/tmp/mail... to 0.
i have done this by adding some "/bin/echo > 0 /var/tmp/mail..." to the cacti cron.

i attached all changed files.
also includes a init script for fedora core.

dirk


Attachments:
File comment: modified mailgraph
mailgraph init script
snmpd.conf change
modified cacti cron
cacti_graph_template_postfix_stats.xml
little install howto

Mailgraph.zip [12.11 KiB]
Downloaded 3323 times
Top
 Profile  
 
 Post subject: Slight Change...
PostPosted: Mon May 09, 2005 4:45 pm 
Offline

Joined: Mon May 09, 2005 4:08 pm
Posts: 37
I stumbled upon this thread while looking for ways to monitor my mail systems with Cacti, and I had a suggestion.

I am running Cacti on a different host than the Postfix install I want to monitor, so the crontab entry included in that zip wasn't going to work in my setup.

A more elegant solution for zeroing out the message counts is to make the SNMP daemon exec a script that returns the count and zeros the counter in one step. I made a script that is called like so: catstat.sh sent - it will return the contents of /var/tmp/mailsent and then replace it with a 0.

Of course this may raise other issues I have yet to discover, but it works for now!

Getting the whole altered mailgraph setup to run on FreeBSD required some other changes, all minor -- paths to binaries and scripts are different -- but it was overall fairly easy.

Now if I could just figure out why cacti goes haywire on my ifDescr indexed ATM interfaces on a Cisco router every time the router reboots, I'd be really happy :) (It's not fun seeing pages of NaN's after a long power outage...) But that's a story for another thread.


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 09, 2005 10:28 pm 
Offline

Joined: Wed Nov 12, 2003 12:30 pm
Posts: 16
yes i agree. the script in the zip does not zero the values. i am by nomeans able to fix the scirpt to do it. but any help would be nice.

--j


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 10, 2005 2:27 pm 
Offline

Joined: Mon May 09, 2005 4:08 pm
Posts: 37
Here is the script that I am using to return the value from the mail counter files and zero them out.

Code:
#!/bin/sh

if [ "$1" = "sent" ] || [ "$1" = "recv" ]  || [ "$1" = "rejected" ] || [ "$1" = "bounced" ] || [ "$1" = "spam" ] || [ "$1" = "virus" ]

then
  /bin/cat /var/tmp/mail$1
  /bin/echo 0 > /var/tmp/mail$1
fi


I reference this from snmpd.conf on the server running postfix as follows:

Code:
exec   mailcount_sent           /path/to/script/catstat.sh sent
exec   mailcount_recv           /path/to/script/catstat.sh recv
exec   mailcount_reject         /path/to/script/catstat.sh rejected
exec   mailcount_bounced        /path/to/script/catstat.sh bounced
exec   mailcount_spam           /path/to/script/catstat.sh spam
exec   mailcount_virus          /path/to/script/catstat.sh virus


I have the script check for the names as a simple measure against shooting ones self in the foot by passing an invalid parameter (i.e. ../../etc/passwd) and having the wrong file overwritten.

I also have altered the graph template to make the Current/Maximum values use the "Exact Numbers" GPRINT type, and use 0 for the unit exponent value. This allows me to get whole number message counts without being converted to other formats. i.e. 2421 messages instead of 2.4k messages, or 24 instead of 24.94 (which is erroneous anyway...)

The postfix server is a spam filter/relay, so it has no local recipients. As such my graph is heavily skewed toward rejected messages and the received & sent are pretty much the same all the time. I had to re-order the values so rejects were on the top otherwise I couldn't see half the other graph values :)

Hope this helps...


Top
 Profile  
 
 Post subject: Big problem...
PostPosted: Tue May 10, 2005 4:05 pm 
Offline

Joined: Mon May 09, 2005 4:08 pm
Posts: 37
While getting this to work I thought the numbers were a little low. The mail server I'm monitoring typically processes about 150,000-200,000 incoming messages per day (70% of which are rejected by RBLs...)

So I went just looking at the code and output trying to determine just exactly what the numbers in the graph were trying to tell me. I thought "Are they messages per second, minute, or 5 minutes?" So I watched the counter files, and they were replaced once per minute, the old values completely ignored. Whichever file happend to be in place when the poller ran was recorded.

In short, anyone using this script is only getting 1 minute out of 5 graphed, and the other values are completely ignored. I modified a version of the already-modified mailgraph script to read in the old numbers and add to them, rather than overwriting them.

Alternately, you could probably change the rrdstep variable to 60*5 instead of 60, but I didn't know if the timing would be off then.

This also means that the value being graphed should be "Messages per 5 minutes" - I suppose one could divide the number in the file by 5 to get a per minute average, or divide it up however you'd like.

Right now I have a dirty hack done to the script to fix this, I'd like a more elegant solution but that will take time. If I get a chance to fix it I'll post a corrected version.

Comments are welcome...


Top
 Profile  
 
 Post subject: Alternate version of Mailgraph for Cacti
PostPosted: Thu May 12, 2005 3:51 pm 
Offline

Joined: Mon May 09, 2005 4:08 pm
Posts: 37
Here is my version of the Postfix Processing stats graph and associated files. It's similar to the other version posted here, but operates differently.

Main differences:
    Works with postfix running on a different host than cacti
    Properly gathers all data for a 5-minute period
    Uses a single data source instead of 6 separate ones
    Collects data via SNMP using a script
    Various alterations of the graph template including ordering of the items as well as using exact numbers for last/max items


Everything should be included in the zip, including install instructions (Though my instructions are geared toward FreeBSD, they should easily adapt to Linux.) All of the templates and items required by cacti should be in the included XML file. You will at least have to check paths in the scripts to make sure they properly point to items such as perl, bash, and snmpwalk.

I named the templates differently so that they would not conflict with the templates from the old version. However, the OID may conflict with the old version.

Some other changes that you can make on your own might be to have Cacti average the data so that it is messages per minute instead of per 5 minutes, and maybe graph type changes such as changing from AREA to LINE types.

Be sure that if you are starting with this version to touch the mail counter files in /var/tmp before starting mailgraph or it will not update. You should execute the following commands:
Code:
      touch /var/tmp/mailreceived
      touch /var/tmp/mailsent
      touch /var/tmp/mailrejected
      touch /var/tmp/mailbounced
      touch /var/tmp/mailspam
      touch /var/tmp/mailvirus


Edited on 5/16 - Updated files to fix some errors.


Attachments:
File comment: Alternate Mailgraph for Cacti implementation.
Read INSTALL for FreeBSD instructions

mailgraph-jjp.zip [13.41 KiB]
Downloaded 3524 times


Last edited by jpingle on Mon May 16, 2005 10:31 pm, edited 1 time in total.
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 108 posts ]  Go to page Previous  1, 2, 3, 4, 5 ... 8  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: Google [Bot] and 13 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