postfix queues random hits

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
flowolf
Posts: 3
Joined: Wed Nov 07, 2007 7:07 am

postfix queues random hits

Post by flowolf »

hello everyone!

i use cacti for almost a year now. but am definitely no expert. i just managed to get serveral standard templates to work.

now that i installed a postfix server i wanted to monitor that as well.

i followed the guide here
after some fiddling and patience i managed to see some spikes.

since the server is not that busy (yet) it handles just some mails per hour.
at the moment i have to be very lucky to catch a mail being delivered when the 5 minute cron job starts the queue poll for postfix.

how can i change this to show me a count of the mails that have been sent in the past 5 minutes, since i last checked on the queues? did i do something wrong?

fyi:

Code: Select all

# snmpwalk -v1 -c public myhost .1.3.6.1.4.1.2021.53.101.0 
UCD-SNMP-MIB::ucdavis.53.101.0.1.1 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.53.101.0.2.1 = STRING: "mailq"
UCD-SNMP-MIB::ucdavis.53.101.0.3.1 = STRING: "/usr/local/bin/getmailq.sh"
UCD-SNMP-MIB::ucdavis.53.101.0.100.1 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.53.101.0.101.1 = STRING: "incoming:0 active:0 deferred:0 hold:0 "
UCD-SNMP-MIB::ucdavis.53.101.0.102.1 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.53.101.0.103.1 = ""

Code: Select all

# cat /usr/local/bin/getmailq.sh 
#!/bin/bash

#getmailq.sh - written by Valec 2006. Steal and share.
#Get postfix queue lengths

#Place in /usr/local/bin/
#exec .1.3.6.1.4.1.2021.53.101.0 mailq /usr/local/bin/getmailq.sh

QUEUES="incoming active deferred hold"

for i in $QUEUES; do
        COUNT=`qshape.pl $i | grep TOTAL | awk '{print $2}'`
        printf "$i:$COUNT "
done 

Code: Select all

# cat /etc/snmp/snmpd.conf | grep getmailq.sh
#exec .1.3.6.1.4.1.2021.53.101.0 mailq /usr/local/bin/getmailq.sh
extend mailq /usr/local/bin/getmailq.sh
thx for help
flowolf
Attachments
just some spikes but definitely more mails have been sent and received.
just some spikes but definitely more mails have been sent and received.
postfix_queues.png (25.55 KiB) Viewed 6806 times
monachus
Posts: 42
Joined: Mon Sep 06, 2004 1:27 am
Location: New York, NY
Contact:

Post by monachus »

you have to consider what your graphing. this particular graphing utility isn't about graphing the number of mails postfix receives - it's about graphing the size of the queue at a given moment in time. my graphs look similar to yours, with the exception of having a deferred queue that floats between 12k and 35k messages throughout the day. this is normal for us because we use postfix on our secondary servers which are drop points for spammers and dictionary attacks.

the usefulness of this graph is to show that the queues are being processed, or that your mail is flowing. if you saw that your deferred queue started growing abnormally, or your inbound queue, or another queue, then you could investigate to see if there's a problem, or if you need to tune postfix for better performance.

i'm not aware of anything that counts every message postfix processes in each queue and records that as a counter for you to graph. it _might_ exist, but it seems like an inefficient use of cpu resources to track it.
Adrian Goins - President / CEO
Arces Network, LLC
http://www.arces.net
flowolf
Posts: 3
Joined: Wed Nov 07, 2007 7:07 am

Post by flowolf »

thanks for your response.

i will look into it :)

greetz
flowolf
enash
Posts: 25
Joined: Tue Oct 04, 2005 9:41 am
Location: Clearwater, FL
Contact:

Bump for Mail graph

Post by enash »

Sry to bump such an old thread, but i have a couple of postfix servers that I would like to use the getmailq.sh script. I have the script working on each of the servers. I can run them from the command line as root and i get the following.

[root@myserver bin]# ./getmailq.sh
incoming:9 active:4 deferred:32 hold:0 [root@myserver bin]#


My only problem is I can not get the graph XML file that was provided with the code. I am unable to get it to load into our older version of cacti. Here is the output of cactid -v

CACTID 0.8.6e Copyright 2002-2005 by The Cacti Group.

I am unable to upgrade the version of cacti because we have tons of other servers that are graphing and i am not allow to upgrade due to the risk of the other serves not being able to continue to graph historically. Can anyone help, either provide me an XML script that will load and not give me the Error XML hash missing error, or help me create new graph in cacti. I started to try to create my own graph in cacti, but my scripting skills are gone, I havent done it in 10 years now. Any help is appreciated..

again, thanks.
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

So, the template won't import due to it being too new. There are a few posts to "hacking" cacti that will allow you to import some, more than likely, but possibly not templates.

Use google and search for the keywords "import hash does not exist site:forums.cacti.net" and see what you come up with.

Which should give you this answer XML Hash Does not Exist

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
enash
Posts: 25
Joined: Tue Oct 04, 2005 9:41 am
Location: Clearwater, FL
Contact:

Post by enash »

Thanks for the response. How painful would it be to try to upgrade cacti to a newer version while its in a production environment?
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

When executed by a trained cacti professional, its quite painless.

L
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

TheWitness wrote:When executed by a trained cacti professional, its quite painless.
Ya'll offer training classes now? :P
enash
Posts: 25
Joined: Tue Oct 04, 2005 9:41 am
Location: Clearwater, FL
Contact:

A way to create my own graph.

Post by enash »

TheWitness wrote:When executed by a trained cacti professional, its quite painless.

L
LOL, i better wait then, next month this wont be an issue we are migrating it to a VM on one of our ESX bladecenters.

I was lead to believe that i could create my own graph through the UI for this script. I started to sniff around in there and found that i didnt have alot of answers to the variables it was asking for. =( I really wanted to use this script. For now ill just have to use the fetch_mail perl script that i have running on my log server.

If anyone has a graph for this script that works with 8.6e please post it.

ty...
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests