|
|
| Author |
Message |
rizcacti
Joined: 25 Jan 2006 Posts: 2
|
Posted: Tue Dec 11, 2007 4:32 pm Post subject: Strange problem |
|
|
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:
Could someone please tell me what is wrong ?
Thanks in advance.
|
|
| Back to top |
|
 |
ScatterBrain
Joined: 09 Jan 2007 Posts: 1
|
Posted: Fri Jan 04, 2008 9:40 am Post subject: |
|
|
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?
| Description: |
| Over night run of the Posftix monitoring script/tempate for Cacti. |
|
| Filesize: |
36.6 KB |
| Viewed: |
4029 Time(s) |

|
|
|
| Back to top |
|
 |
sapofeo
Joined: 17 Feb 2005 Posts: 13
|
Posted: Thu Mar 20, 2008 7:08 am Post subject: |
|
|
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! |
| Description: |
|
| Filesize: |
38.61 KB |
| Viewed: |
3357 Time(s) |

|
|
|
| Back to top |
|
 |
GT4NE1
Joined: 22 Apr 2008 Posts: 3
|
Posted: Tue Apr 22, 2008 5:37 pm Post subject: Not getting output from snmpwalk command |
|
|
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
|
|
| Back to top |
|
 |
sapofeo
Joined: 17 Feb 2005 Posts: 13
|
Posted: Wed Apr 23, 2008 7:33 am Post subject: |
|
|
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
|
|
| Back to top |
|
 |
GT4NE1
Joined: 22 Apr 2008 Posts: 3
|
Posted: Wed Apr 23, 2008 4:48 pm Post subject: |
|
|
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 |
|
|
| Back to top |
|
 |
sapofeo
Joined: 17 Feb 2005 Posts: 13
|
Posted: Thu Apr 24, 2008 7:17 am Post subject: |
|
|
| 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).
|
|
| Back to top |
|
 |
GT4NE1
Joined: 22 Apr 2008 Posts: 3
|
Posted: Thu Apr 24, 2008 11:11 am Post subject: |
|
|
I got it working. Stupid selinux.
Thanks.
|
|
| Back to top |
|
 |
delinquent
Joined: 25 Oct 2007 Posts: 7
|
Posted: Thu Jun 12, 2008 11:01 am Post subject: |
|
|
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 <admin@network.athome>
#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
|
|
|
| Back to top |
|
 |
delinquent
Joined: 25 Oct 2007 Posts: 7
|
Posted: Sat Jun 14, 2008 2:24 am Post subject: |
|
|
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.
|
|
| Back to top |
|
 |
Fred Cacti User
Joined: 03 Jan 2003 Posts: 78
|
Posted: Wed Jul 02, 2008 10:12 am Post subject: |
|
|
| 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).
|
|
| Back to top |
|
 |
mrfree
Joined: 21 Nov 2008 Posts: 2
|
Posted: Fri Nov 21, 2008 6:40 am Post subject: |
|
|
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?
|
|
| Back to top |
|
 |
mrfree
Joined: 21 Nov 2008 Posts: 2
|
Posted: Mon Nov 24, 2008 5:16 am Post subject: |
|
|
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
|
|
| Back to top |
|
 |
|