Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Sat Jul 20, 2019 5:10 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 85 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next
Author Message
 Post subject: Strange problem
PostPosted: Tue Dec 11, 2007 4:32 pm 
Offline

Joined: Wed Jan 25, 2006 6:49 am
Posts: 2
Hello.

I'm trying to graph postfix with this template, but I have some problem.

Code:
server:/usr/local/bin# ./fetch_mail_statistics.pl /var/log/mail.log /var/log/mailstats.db .1.3.6.1.4.1.2021.255 -n .1.3.6.1.4.1.2021.255
.1.3.6.1.4.1.2021.255.0
integer
9


It seems to be ok.

Code:
server:/usr/local/bin# snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.255
UCD-SNMP-MIB::ucdavis.255.0 = INTEGER: 9
UCD-SNMP-MIB::ucdavis.255.1 = INTEGER: 10
UCD-SNMP-MIB::ucdavis.255.2 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.255.3 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.255.4 = INTEGER: 36
UCD-SNMP-MIB::ucdavis.255.5 = INTEGER: 10
UCD-SNMP-MIB::ucdavis.255.6 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.255.7 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.255.8 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.255.9 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.255.10 = INTEGER: 0


..and this is also seems ok.

But the graph isn't ok, as you can see:

Image

Could someone please tell me what is wrong ?

Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 04, 2008 9:40 am 
Offline

Joined: Tue Jan 09, 2007 2:07 pm
Posts: 1
I'm having trouble making this script run in a consistant manner.

My Cacti machine is a separate machine than my mail server(s). I've followed the instructions and it seems to mostly work. But like nuber (his post is on page three of this thread) I've got to run the script manually on the mail server before Cacti can retrieve any data.

But unlike nuber, I get different error messages in the poller log:
Code:
01/04/2008 09:05:22 AM - CMDPHP: Poller[0] Host[41] DS[897] WARNING: Result from SNMP not valid. Partial Result: No Such Instance cur 
01/04/2008 09:05:22 AM - CMDPHP: Poller[0] Host[41] DS[896] WARNING: Result from SNMP not valid. Partial Result: No Such Instance cur 
01/04/2008 09:05:22 AM - CMDPHP: Poller[0] Host[41] DS[895] WARNING: Result from SNMP not valid. Partial Result: No Such Instance cur 
01/04/2008 09:05:22 AM - CMDPHP: Poller[0] Host[41] DS[894] WARNING: Result from SNMP not valid. Partial Result: No Such Instance cur 
01/04/2008 09:05:22 AM - CMDPHP: Poller[0] Host[41] DS[893] WARNING: Result from SNMP not valid. Partial Result: No Such Instance cur 
01/04/2008 09:05:22 AM - CMDPHP: Poller[0] Host[41] DS[892] WARNING: Result from SNMP not valid. Partial Result: No Such Instance cur 
01/04/2008 09:05:22 AM - CMDPHP: Poller[0] Host[41] DS[891] WARNING: Result from SNMP not valid. Partial Result: No Such Instance cur 
01/04/2008 09:05:22 AM - CMDPHP: Poller[0] Host[41] DS[887] WARNING: Result from SNMP not valid. Partial Result: No Such Instance cur 
01/04/2008 09:05:22 AM - CMDPHP: Poller[0] Host[41] DS[888] WARNING: Result from SNMP not valid. Partial Result: No Such Instance cur 
01/04/2008 09:05:22 AM - CMDPHP: Poller[0] Host[41] DS[889] WARNING: Result from SNMP not valid. Partial Result: No Such Instance cur 
01/04/2008 09:05:22 AM - CMDPHP: Poller[0] Host[41] DS[890] WARNING: Result from SNMP not valid. Partial Result: No Such Instance cur 
01/04/2008 09:05:20 AM - CMDPHP: Poller[0] Host[38] DS[883] WARNING: Result from SNMP not valid. Partial Result: No Such Instance cur 
01/04/2008 09:05:20 AM - CMDPHP: Poller[0] Host[38] DS[882] WARNING: Result from SNMP not valid. Partial Result: No Such Instance cur 
01/04/2008 09:05:20 AM - CMDPHP: Poller[0] Host[38] DS[884] WARNING: Result from SNMP not valid. Partial Result: No Such Instance cur 
01/04/2008 09:05:20 AM - CMDPHP: Poller[0] Host[38] DS[885] WARNING: Result from SNMP not valid. Partial Result: No Such Instance cur 
01/04/2008 09:05:20 AM - CMDPHP: Poller[0] Host[38] DS[886] WARNING: Result from SNMP not valid. Partial Result: No Such Instance cur



Host 38 and 41 are my mail servers and the DS entries noted are the Postfix templates. (Host 41 is a Spam Filter and therefore has many more data points to look for.)

I've attached a sample of my output graph below. So my question is what can I do make this any better?


Attachments:
File comment: Over night run of the Posftix monitoring script/tempate for Cacti.
sample.jpg
sample.jpg [ 36.6 KiB | Viewed 14086 times ]
Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 20, 2008 7:08 am 
Offline

Joined: Thu Feb 17, 2005 5:23 pm
Posts: 13
First of all, thanks to all that have worked on this script.

I'm also having an issue capturing data above 1024. The script itself is returning a value of "0" whenever the actual value is above this threshold. I haven't been able to find any information on limitations of perl (arrays, memory issues, etc) that may be causing this. To my untrained eye, the script seems correct. Attached is what I'm seeing. Any insight would be greatly appreciated.

achoi wrote:
Hi,

I am a problem trying to show data that is over 1024. I have already changed to the maximum value in the data template to 100000, but my graph still won't graph anything higher than 1000.

Please help. thanks!


Attachments:
postfix2.JPG
postfix2.JPG [ 38.61 KiB | Viewed 13414 times ]
Top
 Profile  
 
 Post subject: Not getting output from snmpwalk command
PostPosted: Tue Apr 22, 2008 5:37 pm 
Offline

Joined: Tue Apr 22, 2008 5:32 pm
Posts: 7
Hi all,

I'm trying to get this working, but I can't even get an output from the snmpwalk command. Doesn't give an output nor an error.

Code:
snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.255


If I remove the .255, I do get some output.

Code:
snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021
UCD-SNMP-MIB::memIndex.0 = INTEGER: 0
UCD-SNMP-MIB::memErrorName.0 = STRING: swap
UCD-SNMP-MIB::memTotalSwap.0 = INTEGER: 2064376
UCD-SNMP-MIB::memAvailSwap.0 = INTEGER: 2064376
UCD-SNMP-MIB::memTotalReal.0 = INTEGER: 4045072
UCD-SNMP-MIB::memAvailReal.0 = INTEGER: 2955756
UCD-SNMP-MIB::memTotalFree.0 = INTEGER: 5020132
UCD-SNMP-MIB::memMinimumSwap.0 = INTEGER: 16000
UCD-SNMP-MIB::memShared.0 = INTEGER: 0
UCD-SNMP-MIB::memBuffer.0 = INTEGER: 84580
UCD-SNMP-MIB::memCached.0 = INTEGER: 855044
UCD-SNMP-MIB::memSwapError.0 = INTEGER: 0
UCD-SNMP-MIB::memSwapErrorMsg.0 = STRING:
.
.
.


I do get output if I run the following command manually though.

Code:
/usr/local/bin/fetch_mail_statistics.pl /var/log/maillog /var/log/mailstats.db .1.3.6.1.4.1.2021.255 -g .1.3.6.1.4.1.2021.255
.1.3.6.1.4.1.2021.255.0
integer
14


What am I missing? Am I missing some kind of Postfix MIB or something?

Thanks,

-GT


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 23, 2008 7:33 am 
Offline

Joined: Thu Feb 17, 2005 5:23 pm
Posts: 13
I ended up fixing my problems by raising the maximum value in the RRD file.

I recently upgraded to 0.8.7b and blew up again though. NAN across the board.

GT4NE1, did you make the necessary entry in snmp.conf?

pass .1.3.6.1.4.1.2021.255 /usr/local/bin/fetch_mail_statistics.pl /var/log/maillog /var/log/mailstats.db .1.3.6.1.4.1.2021.255


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 23, 2008 4:48 pm 
Offline

Joined: Tue Apr 22, 2008 5:32 pm
Posts: 7
Yes. This snmpd.conf change needs to be made on the monitored host correct?

sapofeo wrote:
I ended up fixing my problems by raising the maximum value in the RRD file.

I recently upgraded to 0.8.7b and blew up again though. NAN across the board.

GT4NE1, did you make the necessary entry in snmp.conf?

pass .1.3.6.1.4.1.2021.255 /usr/local/bin/fetch_mail_statistics.pl /var/log/maillog /var/log/mailstats.db .1.3.6.1.4.1.2021.255


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 24, 2008 7:17 am 
Offline

Joined: Thu Feb 17, 2005 5:23 pm
Posts: 13
yes, on the monitored host. It sounds like the host is setup correctly. Try running the snmpwalk every few seconds. I see that my host tends to time out every so often (granted it throws a timeout error).


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 24, 2008 11:11 am 
Offline

Joined: Tue Apr 22, 2008 5:32 pm
Posts: 7
I got it working. Stupid selinux.

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 12, 2008 11:01 am 
Offline

Joined: Thu Oct 25, 2007 1:27 am
Posts: 10
This error has been discussed before, but this seems to a different issue.

I've had this working before, but if done a reinstall and am now having problems.

Code:
netra-svr:/etc/snmp# snmpwalk -v 2c -c public netra-svr .1.3.6.1.4.1.2021.255
UCD-SNMP-MIB::ucdavis.255 = No Such Instance currently exists at this OID
netra-svr:/etc/snmp# snmpget -v 2c -c public netra-svr .1.3.6.1.4.1.2021.255
UCD-SNMP-MIB::ucdavis.255 = No Such Instance currently exists at this OID
netra-svr:/etc/snmp#


I can run the script manually and it works:

Code:
netra-svr:/usr/local/bin# ./fetch_mail_statistics.pl /var/log/mail.log /var/log/mailstats.db .1.3.6.1.4.1.2021.255 -n .1.3.6.1.4.1.2021.255
.1.3.6.1.4.1.2021.255.0
integer
0


if i use -g rather than -n when i manually run the script, is saves the value for what appears to be the time set in the script by the var $MINRESET

Code:
netra-svr:/usr/local/bin# snmpwalk -v 2c -c public netra-svr .1.3.6.1.4.1.2021.255
UCD-SNMP-MIB::ucdavis.255 = No Such Instance currently exists at this OID
netra-svr:/usr/local/bin# ./fetch_mail_statistics.pl /var/log/mail.log /var/log/mailstats.db .1.3.6.1.4.1.2021.255 -g .1.3.6.1.4.1.2021.255
.1.3.6.1.4.1.2021.255.0
integer
0
netra-svr:/usr/local/bin# snmpwalk -v 2c -c public netra-svr .1.3.6.1.4.1.2021.255
UCD-SNMP-MIB::ucdavis.255.0 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.255.1 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.255.2 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.255.3 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.255.4 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.255.5 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.255.6 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.255.7 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.255.8 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.255.9 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.255.10 = INTEGER: 0
netra-svr:/usr/local/bin#


I can't seem to fault the config. I've done everything right (as far as i know), i haven't changed the values of the fetch_mail_statistics.pl script...

Does anyone have any idea's as to why snmp doesn't seem to be keeping the values? If you need more info, please ask....

Here's my config:
Linux netra-svr.network.athome 2.6.24-1-sparc64 #1 Thu May 8 17:12:30 UTC 2008 sparc64 GNU/Linux

Package: snmpd
Source: net-snmp
Version: 5.4.1~dfsg-7.1


snmpd.conf
Code:
############### SNMPD Configuration ################
#####################################################

################ SECURITY ################

#       sec.name        source          community
com2sec readonly        default         public

#                       sec.model       sec.name
group   MyROGroup       v2c             readonly

#               incl/excl       subtree                          mask
view    all     included        .1                               80

#                context sec.model sec.level match  read   write  notif
access MyROGroup ""      any       noauth    exact  all    none   none


################ GENERAL ################

syslocation Tob of Cabinet, Backroom
syscontact Chris <[email protected]>
#master  agentx


################ MISC ################
pass .1.3.6.1.4.1.2021.255 /usr/local/bin/fetch_mail_statistics.pl /var/log/mail.log /var/log/mailstats.db .1.3.6.1.4.1.2021.255


perl srcipt location
Code:
netra-svr:/usr/local/bin# ls
total 16K
drwxrwsr-x  2 root staff 4.0K 2008-06-12 23:43 .
drwxrwsr-x 10 root staff 4.0K 2008-05-28 19:03 ..
-rwxrwxrwx  1 root root  5.5K 2008-06-12 23:29 fetch_mail_statistics.pl


mailstats file
Code:
netra-svr:/var/log# ls mailstats*
-rwxrwxrwx 1 root root 29 2008-06-12 23:30 mailstats.db


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jun 14, 2008 2:24 am 
Offline

Joined: Thu Oct 25, 2007 1:27 am
Posts: 10
I've fixed my problem.....

For all of those that are intersted, as of snmpd version 5.2 the default user that SNMP runs as has changed from root to snmp. What that basically means is any *fresh* install of snmpd above 5.2 will have snmp as the user, but if you upgraded from a previous version (im refering to debian and apt) it will NOT change the user (hence why this script worked on my previous install which was a old snmpd 4 install).

I've changed the running user back to root and it worked.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 02, 2008 10:12 am 
Offline
Cacti User

Joined: Fri Jan 03, 2003 11:43 am
Posts: 81
GT4NE1 wrote:
I'm trying to get this working, but I can't even get an output from the snmpwalk command. Doesn't give an output nor an error.

...

I got it working. Stupid selinux.

Can you describe what you did?

I'm getting the same behavior. When I run the script manually as the snmp user, /var/db/mailstats.db is created correctly. But when I try to snmpwalk, I get no output (no error, no nothing).


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 21, 2008 6:40 am 
Offline

Joined: Fri Nov 21, 2008 6:36 am
Posts: 2
I'm trying to get it working but...
Code:
/usr/local/bin/fetch_mail_statistics.pl /var/log/mail.log /var/tmp/mailstats.db .1.3.6.1.4.1.2021.255 -n .1.3.6.1.4.1.2021.255
.1.3.6.1.4.1.2021.255.0
integer
0


Code:
snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.255
UCD-SNMP-MIB::ucdavis.255.0 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.255.0 = INTEGER: 0
Error: OID not increasing: UCD-SNMP-MIB::ucdavis.255.0
>= UCD-SNMP-MIB::ucdavis.255.0


Any idea?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 24, 2008 5:16 am 
Offline

Joined: Fri Nov 21, 2008 6:36 am
Posts: 2
okokok... my fault :)
I read the snmpd.conf man and modified the fetch_mail_statistics.pl entry with
Code:
pass .1.3.6.1.4.1.2021.255 /usr/local/bin/fetch_mail_statistics.pl /var/log/mail.log /var/tmp/mailstats.db .1.3.6.1.4.1.2021.255

now it works correctly ;)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 11, 2009 11:34 pm 
Offline

Joined: Wed Feb 11, 2009 11:25 pm
Posts: 1
Hi
I am new to cacti. I want to monitor my postfix server activity.

Imported the host template attached with the first post in this thread into my cacti installation successfully.
Along with host template, it created 2 graph templates, and updated some other stuff too. Seems that the setup serves my purpose.

But I am not able to make out the syntax used in this xml file and am curious to know how to create such template xmls for different purposes. can somebody guide me through the syntax and procedure?

Sorry if I'm asking something trivial. But I think this will help many others too.

-Raja.


Top
 Profile  
 
 Post subject: posfix | cyrus | cacti
PostPosted: Mon Mar 16, 2009 2:37 am 
Offline

Joined: Fri Jun 06, 2008 3:23 pm
Posts: 14
Hi guys,

I tried running the script on the host machine where postfix is running and manage to get a results:

[mailserver]:/export/home/egalura # snmpwalk -v 1 -c [mydomain] [my ip] .1.3.6.1.4.1.2021.255
UCD-SNMP-MIB::ucdavis.255.0 = INTEGER: 123
UCD-SNMP-MIB::ucdavis.255.1 = INTEGER: 40
UCD-SNMP-MIB::ucdavis.255.2 = INTEGER: 24
UCD-SNMP-MIB::ucdavis.255.3 = INTEGER: 3
UCD-SNMP-MIB::ucdavis.255.4 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.255.5 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.255.6 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.255.7 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.255.8 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.255.9 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.255.10 = INTEGER: 0

also i manage to get results where cacti is installed

[localhost]:~ # snmpwalk -v 1 -c [mydomain] [mailserver] .1.3.6.1.4.1.2021.255
UCD-SNMP-MIB::ucdavis.255.0 = INTEGER: 33
UCD-SNMP-MIB::ucdavis.255.1 = INTEGER: 7
UCD-SNMP-MIB::ucdavis.255.2 = INTEGER: 7
UCD-SNMP-MIB::ucdavis.255.3 = INTEGER: 2
UCD-SNMP-MIB::ucdavis.255.4 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.255.5 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.255.6 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.255.7 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.255.8 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.255.9 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.255.10 = INTEGER: 0

but the graph is still empty.
Is this scripts only compatible for the machine where cacti and postfix runs?

Please help? I'm running out of ideas where to look.

thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 85 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 11 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