|
|
| Author |
Message |
bjwi312
Joined: 21 Mar 2006 Posts: 3
|
Posted: Tue Mar 21, 2006 2:35 am Post subject: Can't get to the MIB |
|
|
Hey guys,
Just having a bit of trouble browsing to the correct MIB. I'm running a GENTOO box.
/ # snmpwalk -v 2c -c public [computername] .1.3.6.1.4.1.2021.255 UCD-SNMP-MIB::ucdavis.255 = No Such Object available on this agent at this OID
Have I made a mistake or is there an easy way to find out which branch I should be going to.
Cheers |
|
| Back to top |
|
 |
Mathieu
Joined: 13 Mar 2006 Posts: 12 Location: France
|
Posted: Tue Mar 21, 2006 4:15 am Post subject: |
|
|
First of all, did you have restarted the snmpd daemon after adding the pass configuration line ?
Secondly, the OID is fixed by the pass configuration line :
| Quote: | 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
|
Here the 1.3.6.1.4.1.2021.255 Oid will be assign to fetch script. You can walk the whole Net-SNMP dedicated tree .1.3.6.1.4.1.2021 if you are not sure of the configuration ![/i] |
|
| Back to top |
|
 |
bjwi312
Joined: 21 Mar 2006 Posts: 3
|
Posted: Wed Mar 22, 2006 1:04 am Post subject: |
|
|
The problem was in my version of the fetch_mail_statistics.pl script file, when I had pasted the txt into vi in the cvs comments the $ symbol was not commented out and this was what was causing the script and everything else not to work.
Thanks for all your help... and I will now walk away with head bowed and my tail between my legs. |
|
| Back to top |
|
 |
dsmooth
Joined: 17 Mar 2006 Posts: 8
|
Posted: Fri Apr 21, 2006 5:21 pm Post subject: cacti & amavis |
|
|
| Mathieu, thanks for all the assistance. I finally got it working and in case anyone's interested using snmp to monitor amavis, see http://forums.cacti.net/viewtopic.php?t=3190 |
|
| Back to top |
|
 |
giovanni
Joined: 20 May 2006 Posts: 17
|
Posted: Sun May 21, 2006 3:03 pm Post subject: |
|
|
Hi everyone!
Thanks for the perl script, i've changed to fetch also SPF information and seems to work very well.
But one question, the $MINRESET isnt supposed to be 300 seconds ? The time that cacti waits to get updated information ? Or the Data Source/Template is configured to fetch data at 50/50 seconds ? |
|
| Back to top |
|
 |
giovanni
Joined: 20 May 2006 Posts: 17
|
Posted: Sun May 21, 2006 3:17 pm Post subject: |
|
|
Ops! Sorry, i'd confused heartbeat parameter with Step parameter
PS: I had to insert the OIDs manually
BTW sorry, bad english!  |
|
| Back to top |
|
 |
sandcrawler
Joined: 31 May 2006 Posts: 1
|
Posted: Wed May 31, 2006 4:47 pm Post subject: No Graphs |
|
|
thought I'd mention this to elaborate on a problem I think Giovanni had.
I had mine up and running and I could use snmpwalk to verify stats were being collected. However, I was getting no graphs. If you meet those criteria, you probably need to go to the console, click on the data templates option, then for each option
| Code: |
ucd/net - Postfix - Bad Header
ucd/net - Postfix - Banned Content
|
ETC, you need to manually enter the OID for each query. The OIDs are as follows... this applies to fetch_mail_statistics.pl,v 1.6 2004/11/07
| Code: |
Bad Header - .1.3.6.1.4.1.2021.255.9 (This applied to bad headers passed and blocked)
Banned Content - .1.3.6.1.4.1.2021.255.10
Bounced - .1.3.6.1.4.1.2021.255.3
Clean - .1.3.6.1.4.1.2021.255.5
Deferred - .1.3.6.1.4.1.2021.255.2
Possible Spam - .1.3.6.1.4.1.2021.255.6
Received - .1.3.6.1.4.1.2021.255.0
Rejected - .1.3.6.1.4.1.2021.255.4
Sent - .1.3.6.1.4.1.2021.255.5.1
Spam - .1.3.6.1.4.1.2021.255.7
Virus - .1.3.6.1.4.1.2021.255.8
|
Do not check the box just below "oid" where is says Use Per-Data Source Value (Ignore this Value)
Hope this helps someone as much as it helped me  |
|
| Back to top |
|
 |
bjwi312
Joined: 21 Mar 2006 Posts: 3
|
Posted: Mon Jun 05, 2006 3:44 am Post subject: Problem with Potential Spam and Spam graphs |
|
|
Hey Guys,
I was having problems with possibly spam and spam being shown on the Mail filtering graph.
So I checked the header information and I realised that my "Hits" was not what my system was using in the X-Spam- header but actually score.
So I have modified the fetch_mail_statistics.pl file. Unfortunatley I really don't care about possible spam... As I rarely find that my setup gets false positives. But hey... no biggie just pass through all mail to my users that under a certain score but wrap it so I preface it that it may be spam. That should keep them happy.
Ok so what code did I change well I basically deleted the lines in the elsif that refer to spam and posible spam and added
elsif ( /score=([-+]?[0-9]*\.?[0-9]+)/) {
$hits = $1;
$num_clean++ if ($hits < $SPAMLVL);
$num_spam++ if ($hits >= $SPAMLVL);
}
That way the num clean increments and the number that spam increment.
If you want to check syntax on your own box or check certain things use this script
#! /usr/bin/perl -W
$temp = 0;
$SPAMLVL = 6.3;
print "opening file\n";
open (TEMP, "/var/log/amavis.log") or die "can't open file \n";
while ( <TEMP> ){
#print $_;
if( /score=([-+]?[0-9]*\.?[0-9]+)/) {
$temp++ if ($1 >= $SPAMLVL);
#print $2;
#print "\n";
#$temp = $temp + $0;
}
}
print $temp;
Just modify the if as need be and the componenets you want to search for. I have left a couple of test print statments in the loop just uncomment them as need be. Please also don't forget to change the log file that you are using.
Thanks for the great scripts and posts by everyone I have found it really helpful and currently have a fully working system that use Postfix, Amavis, ClamAV, DCC, pyzor, LDAP, MYSQL, Spamassasin and Cacti. I can now monitor both my Postfix and Amavis to see what is really going on in the system.
Hopefully before my contract is up I will be working on a per/domain monitoring system. If I get it to work in time I will post it. |
|
| Back to top |
|
 |
@ryaz
Joined: 31 May 2006 Posts: 14 Location: France
|
Posted: Wed Jun 07, 2006 4:14 am Post subject: [newbie with postfix] |
|
|
Hello,
my MTA is postfix, but i don't find my /var/log/mailstats.db...
Where (or in which config file) do i find this file?
I found : /etc/postfix/access.db...
Regards, |
|
| Back to top |
|
 |
Mathieu
Joined: 13 Mar 2006 Posts: 12 Location: France
|
Posted: Thu Jul 06, 2006 10:58 am Post subject: |
|
|
Hi ryaz, the mailstat.db file is created by the Perl script called fetch_mail_statistics.pl.
You must first call the script by hand to get the file created or configure snmpd with a line like the below example and then walk throught the OID thanks to snmpwalk.
| Code: |
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 |
Hope this will help you a little.
Mathieu[/b] |
|
| Back to top |
|
 |
nuber
Joined: 12 Jul 2006 Posts: 3
|
Posted: Wed Jul 12, 2006 10:58 pm Post subject: |
|
|
I have followed Instigater's instructions, but have been unable to maintain the statistics in SNMP. The only way I've been able to get it to work is by first doing this on the mail server:
| Code: | | /etc/snmp/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 |
Upon running that piece of code, it shows the following in SNMP:
| Code: | snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.255
UCD-SNMP-MIB::ucdavis.255.0 = INTEGER: 5
UCD-SNMP-MIB::ucdavis.255.1 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.255.2 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.255.3 = INTEGER: 0
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 |
However, that information is quickly deleted for some reason (MINRESET?).
Therefore, after that information expires, the poller generates the following error which was documented earlier in this thread.
| Code: | Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: .1.3.6.1.4.1.2021.255.0
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: .1.3.6.1.4.1.2021.255.4
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: .1.3.6.1.4.1.2021.255.1 |
Anyone have some ideas on what I might be doing wrong?
Thanks ahead of time! |
|
| Back to top |
|
 |
Mathieu
Joined: 13 Mar 2006 Posts: 12 Location: France
|
Posted: Thu Jul 13, 2006 3:24 am Post subject: |
|
|
You migth have done some modification on the fetch perl script. Could you attach your version of the script to a forum post ?
For your question on $MINRESET script variable, here is a brief description on how it is used in the script .
Begin Script
Compute TimeSinceLastUpdate
If TimeSinceLastUpdate > $MINRESET
Compute NewStatistics
Store NewStatistics Into Dbfile
End If
Load Statistics Out of Dbfile
Print Statistics
End Script
Mathieu |
|
| Back to top |
|
 |
@ryaz
Joined: 31 May 2006 Posts: 14 Location: France
|
Posted: Thu Jul 13, 2006 4:11 am Post subject: |
|
|
Hello, i have one question for you :
- the poller.php of cacti runs all 5 minutes, well what changement/modification to do in my fetch_mail_statistics.pl ?
thanks |
|
| Back to top |
|
 |
Mathieu
Joined: 13 Mar 2006 Posts: 12 Location: France
|
Posted: Thu Jul 13, 2006 4:15 am Post subject: |
|
|
In my script MINRES = 50.
It means that is DbFile last modification date is past by more than 50s the statistics are recomputed. |
|
| Back to top |
|
 |
@ryaz
Joined: 31 May 2006 Posts: 14 Location: France
|
Posted: Thu Jul 13, 2006 4:39 am Post subject: |
|
|
thank you, and acoording to you what would be the best value for me?
I'am certainly stupid,the value must be 5*60? |
|
| Back to top |
|
 |
|