Ad blocker detected: Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker on our website.
OK so theres is no way i can upgrade cacti right now, so I have to get this graphing some how.. I have followed serveral of the ideas in this thread. I have getmailq.sh working on the mail server itself. I also have used the idea from one post to have the output going to a file that is readable. Both work. So now here is what is left that i need to do. Be able to have the cacti host produce a readable graph by doing one of the following, either via snmp call the getmailq.sh script on the mail server and get the results and graph them, or read the mailqueuestats file i have that gets data every minute from crontab and graph those results. I guess the final problem is how do i graph my results from my script? Non of the XML templates will load, I get XML hash or parse error. And i believe its because i am using version 0.8.6e.
If you absolutely must get this working, you have two options, neither of which may or may not work
1) look in the include directory for the file that contains the version hashes and change it so that the hash is associated with a known version. make a backup first and restore it afterwards, obviously.
2) use regular expressions to search and replace the hash information in the file you are trying to import. this is how I make my templates work with older versions--I change the exported hash version.
I'm rather new to cacti and snmp; so please forgive me if i'm asking for the wrong things.
I'm trying to get my outgoing mailserver graphed (postfix) in cacti.
On the mailserver I've this script :
#!/bin/sh
QUEUES="incoming active deferred hold"
for i in $QUEUES; do
# COUNT=`qshape $i | grep TOTAL | awk '{print $2}'`
# COUNT=`find /var/spool/postfix/$i -maxdepth 5 -type f | wc -l`
COUNT=`find /var/spool/postfix/$i -type f | wc -l`
printf "$i:$COUNT "
# printf "$i:456 "
done
This is called getmailq.sh
When I run in from the commandline it counts the messages in the 4 postfix queues and returns e.g. :
incoming:1 active:0 deferred:80 hold:0
But; when I do a snmpwalk; like :
%snmpwalk -Oav -v 2c -c public xxx.xxx.xxx.xxx .1.3.6.1.4.1.2021.53.101.0.4
It returns : STRING: "incoming:2 active:0 deferred:0 hold:0 "
So the deferred count won't be in my string...
The data is furthermore processed in Cacti; and the graph is being made.
Cacti is running on a different machine; but I think the problem is somewhere in snmp because it doesn't pick up the right data ?
I don't think it 's a rights-problem; the user snmp has rights to read the contens of the /var/spool/postfix/active, /deferred, /incoming and /hold-directories...
When running this on another mailserver; I receive the right data of the queue; but my snmp-walk string must be different (may be another version of net-snmp; i've the figure this out).
monachus wrote:if using newer versions of net-snmp, you should use the extend directive instead of the exec directive, which will require some changes to the scripts:
also, in newer versions of postfix, "qshape" has become "qshape.pl." check on your system for the updated version.
This was great advice, though to make it work I had to change the 'cut' part to a sed command as it was just returning "mailq" since it was in double quotes. Here's the sed command I used to replace the cut command, now this awesome mailq monitor script is working for me