Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Wed Jun 26, 2019 11:34 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: Can't get to the MIB
PostPosted: Tue Mar 21, 2006 2:35 am 
Offline

Joined: Tue Mar 21, 2006 2:30 am
Posts: 3
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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 21, 2006 4:15 am 
Offline

Joined: Mon Mar 13, 2006 5:40 am
Posts: 12
Location: France
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]


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 22, 2006 1:04 am 
Offline

Joined: Tue Mar 21, 2006 2:30 am
Posts: 3
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.


Top
 Profile  
 
 Post subject: cacti & amavis
PostPosted: Fri Apr 21, 2006 5:21 pm 
Offline

Joined: Fri Mar 17, 2006 2:01 pm
Posts: 8
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


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 21, 2006 3:03 pm 
Offline

Joined: Sat May 20, 2006 8:06 pm
Posts: 17
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 ?


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 21, 2006 3:17 pm 
Offline

Joined: Sat May 20, 2006 8:06 pm
Posts: 17
Ops! Sorry, i'd confused heartbeat parameter with Step parameter :)

PS: I had to insert the OIDs manually

BTW sorry, bad english! :lol:


Top
 Profile  
 
 Post subject: No Graphs
PostPosted: Wed May 31, 2006 4:47 pm 
Offline

Joined: Wed May 31, 2006 4:36 pm
Posts: 1
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 :)


Top
 Profile  
 
 Post subject: Problem with Potential Spam and Spam graphs
PostPosted: Mon Jun 05, 2006 3:44 am 
Offline

Joined: Tue Mar 21, 2006 2:30 am
Posts: 3
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.


Top
 Profile  
 
 Post subject: [newbie with postfix]
PostPosted: Wed Jun 07, 2006 4:14 am 
Offline

Joined: Wed May 31, 2006 3:34 pm
Posts: 14
Location: France
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,


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 06, 2006 10:58 am 
Offline

Joined: Mon Mar 13, 2006 5:40 am
Posts: 12
Location: France
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]


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 12, 2006 10:58 pm 
Offline

Joined: Wed Jul 12, 2006 10:51 pm
Posts: 3
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!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 13, 2006 3:24 am 
Offline

Joined: Mon Mar 13, 2006 5:40 am
Posts: 12
Location: France
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


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 13, 2006 4:11 am 
Offline

Joined: Wed May 31, 2006 3:34 pm
Posts: 14
Location: France
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


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 13, 2006 4:15 am 
Offline

Joined: Mon Mar 13, 2006 5:40 am
Posts: 12
Location: France
In my script MINRES = 50.
It means that is DbFile last modification date is past by more than 50s the statistics are recomputed.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 13, 2006 4:39 am 
Offline

Joined: Wed May 31, 2006 3:34 pm
Posts: 14
Location: France
thank you, and acoording to you what would be the best value for me?

I'am certainly stupid,the value must be 5*60?


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 8 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