Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Mon Jun 17, 2019 11:57 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 40 posts ]  Go to page Previous  1, 2, 3
Author Message
 Post subject: Re: Anyone...
PostPosted: Tue Jun 30, 2009 7:18 am 
Offline

Joined: Tue Oct 04, 2005 9:41 am
Posts: 25
Location: Clearwater, FL
sterpstra wrote:
Sorry for the bump but I would like to get this template working before I go over to the Mailgraph-based one...

Anyone have any ideas?
[/quote]

Has anyone got this working.. Error: XML: Hash version does not exist.


Top
 Profile  
 
 Post subject: think i found it.
PostPosted: Tue Jun 30, 2009 7:32 am 
Offline

Joined: Tue Oct 04, 2005 9:41 am
Posts: 25
Location: Clearwater, FL
I realized i am running version CACTID 0.8.6e. I will just have to wait till I upgrade the server and reinstall cacti.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 01, 2009 12:02 pm 
Offline

Joined: Tue Oct 04, 2005 9:41 am
Posts: 25
Location: Clearwater, FL
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.

someone help!!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 01, 2009 2:37 pm 
Offline
Cacti User

Joined: Fri Dec 09, 2005 3:42 pm
Posts: 246
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.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 28, 2009 4:50 am 
Offline

Joined: Mon Jul 27, 2009 11:52 am
Posts: 8
Location: Netherlands
Hello,

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).


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 05, 2009 4:24 pm 
Offline

Joined: Sun Aug 17, 2008 2:19 pm
Posts: 5
Just in case anyone else didn't feel like having to enter in a separate host IP address for this graph, I edited the template.

Thanks for all the work everyone!
-Eric


Attachments:
File comment: this template uses the devices management ip
cacti_graph_template_postfix_queues.xml [18.47 KiB]
Downloaded 713 times
Top
 Profile  
 
 Post subject: Re: Postfix Queues
PostPosted: Wed Dec 30, 2009 5:02 am 
Offline

Joined: Thu Apr 12, 2007 1:48 am
Posts: 17
valec wrote:
And on the Cacti host I have:
Code:
#!/bin/bash
#/usr/share/cacti/site/scripts/postfixqueues.sh

output=`/usr/bin/snmpwalk -Oav -v2c -c syzygy $1 .1.3.6.1.4.1.2021.53.101.0.101.1 | cut -d '"' -f 2`
printf "$output"
echo



I had the output
Code:
/var/www/cacti/scripts/postfixqueues.sh: line 6: echo: write error: Broken pipe


So I canged the script to
Code:
#!/bin/bash
output=`/usr/bin/snmpwalk -Oav -v2c -c syzygy $1 .1.3.6.1.4.1.2021.53.101.0.101.1 | cut -d '"' -f 2`
echo $output


And now am lucky!
Thanks for the script and the templates!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 05, 2010 3:59 am 
Offline

Joined: Tue May 04, 2010 8:52 am
Posts: 5
Hello,

in SNMP, can be decomposed into integer values rather than having a string ?

Thanks


Top
 Profile  
 
 Post subject: Re: Postfix Queues
PostPosted: Thu Jun 28, 2012 10:58 pm 
Offline

Joined: Thu Jun 28, 2012 10:52 pm
Posts: 2
Help me plz guys!
I dont understand what iv do wrong
Graph does not show

On cacti server:
snmpwalk -v 1 -c public 10.20.100.244 .1.3.6.1.4.1.2021.53.101.0
UCD-SNMP-MIB::ucdavis.53.101.0.1.0 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.53.101.0.2.1.2.5.109.97.105.108.113 = STRING: "/usr/local/bin/getmailq.sh"
UCD-SNMP-MIB::ucdavis.53.101.0.2.1.3.5.109.97.105.108.113 = ""
UCD-SNMP-MIB::ucdavis.53.101.0.2.1.4.5.109.97.105.108.113 = ""
UCD-SNMP-MIB::ucdavis.53.101.0.2.1.5.5.109.97.105.108.113 = INTEGER: 5
UCD-SNMP-MIB::ucdavis.53.101.0.2.1.6.5.109.97.105.108.113 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.53.101.0.2.1.7.5.109.97.105.108.113 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.53.101.0.2.1.20.5.109.97.105.108.113 = INTEGER: 4
UCD-SNMP-MIB::ucdavis.53.101.0.2.1.21.5.109.97.105.108.113 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.53.101.0.3.1.1.5.109.97.105.108.113 = STRING: "incoming: 0 active: 0 deferred: 2 hold: 0 "
UCD-SNMP-MIB::ucdavis.53.101.0.3.1.2.5.109.97.105.108.113 = STRING: "incoming: 0 active: 0 deferred: 2 hold: 0 "
UCD-SNMP-MIB::ucdavis.53.101.0.3.1.3.5.109.97.105.108.113 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.53.101.0.3.1.4.5.109.97.105.108.113 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.53.101.0.4.1.2.5.109.97.105.108.113.1 = STRING: "incoming: 0 active: 0 deferred: 2 hold: 0 "

On monitor server:
snmpwalk -v 1 -c public 10.20.100.244 .1.3.6.1.4.1.2021.53.101.0
UCD-SNMP-MIB::ucdavis.53.101.0.1.0 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.53.101.0.2.1.2.5.109.97.105.108.113 = STRING: "/usr/local/bin/getmailq.sh"
UCD-SNMP-MIB::ucdavis.53.101.0.2.1.3.5.109.97.105.108.113 = ""
UCD-SNMP-MIB::ucdavis.53.101.0.2.1.4.5.109.97.105.108.113 = ""
UCD-SNMP-MIB::ucdavis.53.101.0.2.1.5.5.109.97.105.108.113 = INTEGER: 5
UCD-SNMP-MIB::ucdavis.53.101.0.2.1.6.5.109.97.105.108.113 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.53.101.0.2.1.7.5.109.97.105.108.113 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.53.101.0.2.1.20.5.109.97.105.108.113 = INTEGER: 4
UCD-SNMP-MIB::ucdavis.53.101.0.2.1.21.5.109.97.105.108.113 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.53.101.0.3.1.1.5.109.97.105.108.113 = STRING: "incoming: 0 active: 0 deferred: 2 hold: 0 "
UCD-SNMP-MIB::ucdavis.53.101.0.3.1.2.5.109.97.105.108.113 = STRING: "incoming: 0 active: 0 deferred: 2 hold: 0 "
UCD-SNMP-MIB::ucdavis.53.101.0.3.1.3.5.109.97.105.108.113 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.53.101.0.3.1.4.5.109.97.105.108.113 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.53.101.0.4.1.2.5.109.97.105.108.113.1 = STRING: "incoming: 0 active: 0 deferred: 2 hold: 0 "


Attachments:
Postfix Queues.jpg
Postfix Queues.jpg [ 67.6 KiB | Viewed 2617 times ]
Top
 Profile  
 
 Post subject: Re:
PostPosted: Thu Jun 25, 2015 2:14 pm 
Offline

Joined: Thu Jun 25, 2015 11:03 am
Posts: 2
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:

in snmpd.conf:
Code:
extend mailq /usr/local/bin/getmailq.sh



in postfixqueues.sh:
Code:
/usr/bin/snmpget -Oqav -v2c -c<community> -t30 $1 'NET-SNMP-EXTEND-MIB::nsExtendOutLine."mailq".1' | cut -d '"' -f 2


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 :)

Code:
sed -n -e 's/^.*STRING: //p'


Example output of the script after this change:

incoming:0 active:0 deferred:1 hold:0

Love this forum, thanks to everyone who's here :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 40 posts ]  Go to page Previous  1, 2, 3

All times are UTC - 5 hours


Who is online

Users browsing this forum: jayarathna and 6 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