Cactiusers.org


It is currently Mon May 21, 2012 4:52 pm




Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
 Receiving Traps 
Author Message
User

Joined: Thu Aug 24, 2006 3:27 am
Posts: 45
Post Receiving Traps
Hey,

I've read in a seperate topic that it should be able to recieve traps with cacti? i'm very intrested in this since most of our network device can do this. Anybody has more info about this tool? How can i install/configure it?


farhan wrote:
Hi folks,

Those who want to send SNMP trap to syslog they can use snmptt. It is excellent tool. I have been using this tool and snmptt dumps everything in syslog-ng and u can see everything under syslog plugin. If you need any further help please let me know.


Tue Sep 05, 2006 3:09 am
New User

Joined: Wed Dec 14, 2005 10:41 pm
Posts: 23
Post 
Hello Brononi,

It is very easy and straight forward. You need to install

Snmptt(http://www.snmptt.org/) and load all devices(cisco,juniper) mibs in

SNMPTT. Configure cisco devices to send snmp traps to this box ,snmptt

will capture these traps ,format these and dump into syslog.

You will configure syslog-ng to filter SNMPTT logs and send all these events

in respective tables in mysql. Finally, cacti with haloe plugin will display

all these on webpage. I think it helps you.

If you need any configuration help or some thing else, I will be more than

happy to support you.

Thanks,

Farhan


Tue Sep 05, 2006 7:19 pm
User

Joined: Thu Aug 24, 2006 3:27 am
Posts: 45
Post 
sounds easy :P

I've started with snmptt, but get stuck with the configuration of that already.
Do I need to make extra tables in the 'cacti DB'? What are the exact settings for the snmptt.ini <> DB?


Thanks already!!!


Wed Sep 06, 2006 12:40 am
New User

Joined: Fri Apr 07, 2006 8:15 am
Posts: 13
Post 
I'm very interested in this as well,,, I have the haloe setup in cacti as well but i'd like to know if the notification part works?? I probably can get this setup to accept traps i guess, then into haloe but i want to know if haloe email function works?? Anyone else get this working?? with some typ of notification.


Wed Sep 06, 2006 10:27 am
New User

Joined: Fri Apr 07, 2006 8:15 am
Posts: 13
Post 
Farhan..

Can you provide the steps you took to setup all components of getting snmptt to work ..snmpd, snmptt, I already have the syslog-ng working with cacti. I'd just like to get same server to accept traps and translate them and send them over to syslog-ng. And in the end have alerting done from that in cacti

thanks


Wed Sep 06, 2006 3:38 pm
New User

Joined: Wed Dec 14, 2005 10:41 pm
Posts: 23
Post 
Hello Guys,

There is no need to create any extra table in cacti for snmptt. First of all you will install snmptt and then you muts have cisco or other vendor mibs. Then you will install these mibs through following commands

snmpttconvertmib --in=/tmp/ciscoMgmt/all --out=/etc/snmp/snmptt-cisco.conf

snmpttconvertmib --in=/tmp/juniper/all --out=/etc/snmp/snmptt-juniper.conf

And then you will have make following changes in snmptt.ini

snmptt_conf_files = <<END
/etc/snmp/snmptt-cisco.conf
/etc/snmp/snmptt-juniper.conf
END

And turn on syslog opetion in snmptt.ini like

syslog_system_enable = 1

So, in this way snmptt logs all the messages to syslog. And then you will

configure syslog-ng to filter these logs and insert in to database.

destination snmptt { file("/var/log/snmptt"); };
filter f_snmptt { program(snmptt); };
log { source(src); filter(f_snmptt); destination(snmptt); };

destination d_mysql {
pipe("/var/log/mysql.pipe"
template("INSERT INTO haloe_incoming
(host, facility, priority, level, tag, date,time, program, message)
VALUES ( '$HOST', '$FACILITY', '$PRIORITY', '$LEVEL', '$TAG', '$YEAR-$MONTH-$DAY','$HOUR:$MIN:$SEC',
'$PROGRAM', '$MSG' );\n") template-escape(yes));
};

log {
source(src); filter(f_snmptt);
destination(d_mysql);
};

Now syslog-ng filter the snmptt messages and insert into to mysql. Now you will configure haloe to view these messages.

I think it will help you.

Cheers,

Farhan


Thu Sep 07, 2006 9:42 pm
New User

Joined: Fri Apr 07, 2006 8:15 am
Posts: 13
Post 
Thanks ...........I'll start working on that for sure...Dont' we also need snmptrapd running as well>>> Any special configs forthat ??


Fri Sep 08, 2006 1:32 pm
New User

Joined: Wed Dec 14, 2005 10:41 pm
Posts: 23
Post 
Off course you need to configure snmptrapd.conf for traphandling.

For standlone mode: Modify the snmptrapd.conf file by adding the following line:

traphandle default /usr/sbin/snmptt

For daemon mode: Modify the snmptrapd.conf file by adding the following line:

traphandle default /usr/sbin/snmptthandler

snmptrapd traps all snmp events and passes to snmptt.


Cheers,

Farhan


Fri Sep 08, 2006 9:21 pm
New User

Joined: Mon Sep 11, 2006 6:05 am
Posts: 17
Post How do I test
I already have syslog ng runninng on alinux box, I followed the instructions to set up snmptt to send the traps to my syslog ng that I can view on my cacti plugin


I was just hoping you could tell me how I can send a snmp trap message to my linux box so that I can view it with cacti

Thanks


Mon Sep 11, 2006 6:10 am
New User

Joined: Fri Apr 07, 2006 8:15 am
Posts: 13
Post 
I've setup snmptrapd and it works......i think ihave snmptt working?? But Ihave one question though..when I start snmptrapd i get a huge flood into my syslog server like tons?? How is this supposedto work ?? Isnt' only supposed to be traps coming from the server mibs and server or devices i've added///All i've added so far is 1 server and the 3 Dell mibs that come with OpenManage...and man its just a flood of stuff coming in./???

Any help would be awesome...anyone get this working in linux with all files and programs setup would be good?? example configs or just basic starting point


Mon Sep 11, 2006 1:18 pm
New User

Joined: Wed Dec 14, 2005 10:41 pm
Posts: 23
Post 
Hello gmailtester,

You need to configure devcies(cisco,juniper) to send snmp traps to your cacti box like as follow for cisco.

snmp-server trap-source FastEthernet0/0
snmp-server enable traps snmp authentication linkdown linkup coldstart warmstart
snmp-server enable traps tty
snmp-server enable traps isdn call-information
snmp-server enable traps isdn layer2
snmp-server enable traps hsrp
snmp-server enable traps config
snmp-server enable traps entity
snmp-server enable traps envmon
snmp-server enable traps bgp
snmp-server enable traps rsvp
snmp-server enable traps frame-relay
snmp-server enable traps rtr
snmp-server host 10.10.10.10 public

I hope it helps


Tue Sep 12, 2006 12:04 am
New User

Joined: Wed Dec 14, 2005 10:41 pm
Posts: 23
Post 
spoonman wrote:
I've setup snmptrapd and it works......i think ihave snmptt working?? But Ihave one question though..when I start snmptrapd i get a huge flood into my syslog server like tons?? How is this supposedto work ?? Isnt' only supposed to be traps coming from the server mibs and server or devices i've added///All i've added so far is 1 server and the 3 Dell mibs that come with OpenManage...and man its just a flood of stuff coming in./???

Any help would be awesome...anyone get this working in linux with all files and programs setup would be good?? example configs or just basic starting point


Hello spoonman,

Yes syslog will be flooded because snmptrapd and snmptt both sending

snmp messages to syslog but you have to care only snmptt. When cisco or

other device sends snmp trap to cacti box, snmptrapd and snmptt both

sends snmp traps in syslog. But we need only snmptt.


For this you have to configure syslog-ng to do this as follow.

destination snmptt { file("/var/log/snmptt"); };
filter f_snmptt { program(snmptt); };
log { source(src); filter(f_snmptt); destination(snmptt); };

destination d_mysql {
pipe("/var/log/mysql.pipe"
template("INSERT INTO haloe_incoming
(host, facility, priority, level, tag, date,time, program, message)
VALUES ( '$HOST', '$FACILITY', '$PRIORITY', '$LEVEL', '$TAG', '$YEAR-$MONTH-$DAY','$HOUR:$MIN:$SEC',
'$PROGRAM', '$MSG' );\n") template-escape(yes));
};

log {
source(src); filter(f_snmptt);
destination(d_mysql);
};



So, in this way syslog-ng only insert snmptt record in mysql and haloe will display these for you. In this way you will get rid of linux generic syslog messages(crond,mail,console etc) as well.

Cheers,

Farhan


Tue Sep 12, 2006 1:42 am
New User

Joined: Fri Apr 07, 2006 8:15 am
Posts: 13
Post 
What is it constantly sending? Why doesnt' it only send traps that the devices are setup to send traps on?


Wed Sep 13, 2006 7:50 am
User

Joined: Thu Aug 24, 2006 3:27 am
Posts: 45
Post 
farhan wrote:
snmpttconvertmib --in=/tmp/ciscoMgmt/all --out=/etc/snmp/snmptt-cisco.conf


What do you mean with all? I'm trying to do it for our checkpoint machines, but when i unzip the mib file, a lot of TXT files are placed. Do i need to convert them all one by one, or is there a way to convert them all in one file?



farhan wrote:
configure syslog-ng to filter these logs and insert in to database.

How do i configure this syslog-ng? Is this a tool that i must install seperated? Or is it standard with cacti/haloe?


Sorry for the maybe stupid questions... :$


Thu Sep 14, 2006 1:25 am
New User

Joined: Wed Dec 14, 2005 10:41 pm
Posts: 23
Post 
Brononi,

You can load all files one by one or can write a perl script. I have a perl

script for this. You can copy all your checkpoints file in /tmp/checkpoint

directory and run following script


#!/usr/bin/perl

sub getfiles {

opendir(DIR,"/tmp/checkpoint");

while($file = readdir(DIR)) {

if($file !~ /^\./) {

foreach $all ($file) {

system("/root/snmptt_1.1/snmpttconvertmib --in=/tmp/ciscoMgmt/$all --out=/etc/snmp/snmptt-d.conf");
print "$all\n";
}
}
}
closedir(DIR);
}

&getfiles;

Syslog-ng is separate from cacti. It is like generic syslog daemon.

Cheers,

Farhan


Thu Sep 14, 2006 7:26 pm
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next


Who is online

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