Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I send an snmp trap from RME using Automated action

Status
Not open for further replies.

mikestephens

IS-IT--Management
Jun 13, 2001
2
GB
Hi,

I am using the Ciscoworks 2000 Campus Bundle. I have setup automated actions (email) within syslog (RME). I want to be able to send out snmp traps to OpenView instead.

Has anybody already done this, or know how to do it.

Thanks in advance.
 
This doesn't answer what you asked but I would like to know what RME truly is? Can you explain? Perhaps with research, I can help you.?
 
Why bother? Cut out the middleman and add setup the routers and switches to send the traps to OpenView ( in addtion to CWSI if you like). I don't have the commands handy but set the trap-recipient to OV in the routers/switches just like you did for CWSI.
 
We already send traps from some of our cisco gear, however we have a lot of info going through our openview and it is beginning to struggle with the amount of data. The idea was to use Ciscoworks as the filter.

thanks for the response.
 
I had a similar dilemma. Just finished putting this Perl script together to send traps as an additional action in RME. You will need to modify the trap destination, etc. You may also have to compile it if you don't have the correct modules installed. Better error detection is also warranted.
Ex: .send_cw2_trap.pl -t $M
Where $M is the contents of the syslog message.

#! /usr/local/bin/perl

# Usage: send_cw2_trap.pl -t $M

eval '(exit $?0)' && eval 'exec /usr/local/bin/perl $0 ${1+"$@"}'
&& eval 'exec /usr/local/bin/perl $0 $argv:q'
if 0;

# use strict;

use Getopt::Std;
use Net::SNMP qw:)ALL);

getopts('t:');

my ($session, $error) = Net::SNMP->session(
-hostname => $ARGV[0] || 'wolverine',
-community => $ARGV[1] || 'public',
-port => SNMP_TRAP_PORT,
);

if(!defined($session)) {
printf ("ERROR: %s.\n", $error);
exit 1;
}

my $result = $session->trap(
-enterprise => '1.3.6.1.4.1.8000',
-agentaddr => '10.60.24.68',
-specifictrap => 0,
-varbindlist => [
'1.3.6.1.4.1.8000.1.0', OCTET_STRING, $opt_t,
]
);


if (!defined($result)) {
printf ("ERROR: %s.\n", $session->error());
}
else {
printf ("SNMPv2-Trap-PDU sent.\n");
}

$session->close();
exit 0;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top