Hi Marcos,
I think you will find the man snmptrap command does give information on
sending slot (varbind) values but it isn't very helpful with examples.
Also beware that both your Operaating System and your NetView may
provide an snmptrap binary.
Basically you provide slot values as triplets of
variable name variable type variable value
where variable name is an ASN.1 OID, variable type is something like
Octetstring or Timeticks (see the man page) and the variable value is an
appropriate value.
To find out what slots are defined by a manufacturer's trap, you need to
consult his documentation. If this is sparse and you are getting this
trap into NetView, reconfigure the trap so that the Event Log Message
field just says $* - this will then dump all the trap variables. After
that, it's up to you to do the detective work to find out what it's
trying to say!
Appended is a sample script with a single trap variable.
Cheers,
Jane
------------------------------
#!/bin/ksh
#
# Send trap using the snmptrap supplied with NetView in /usr/OV/bin
# Trap here is NetView enterprise specific trap 1001
# $1 is variable string including interface
# $2 is host with failing interface (passed as $A from NetView)
HOST=$2
# set $1 splits out the 4 space-separated vars of the original $1
# into $1 $2 $3 $4 - new $1 = interface, 2=time since epoch
#
set $1
#
# Uncomment next line for extra debugging
#set -x
MANAGER=poppet.skills-1st.co.uk
ENTERPRISE=.1.3.6.1.4.1.2.6.3.1
GENTRAP=6
SPECTRAP=1001
TIMESTAMP=1
TRAPVAR=.1.2.6.1.4.1.2.6.3.1.1.2.0
MESSAGE="Interface $1 failed on $HOST"
#
/usr/OV/bin/snmptrap $MANAGER $ENTERPRISE $HOST $GENTRAP $SPECTRAP
$TIMESTAMP \
$TRAPVAR OctetString "$MESSAGE"
#
------------------------------
Marcos Antonio Pezzutti Filho wrote:
Dear friends,
Good Morning,
My enterprise:
Netview 7.1.4
AIX 4.3.3 ML-10
Framework 3.7.1 (FP-04)
I´d like to know how to get more information about the snmptrap
command. The command man page doesn´t have the specific information I
need.
I´d like to create a script that generates a trap with possibility of
configuring the slots.
ie:
#!/bin/ksh
# teste_trap.sh
# Command that generates Node down SNMP traps
snmptrap 127.0.0.1 \
.1.3.6.1.4.1.2.6.3.1 \
180.187.215.19 \
6 58916865 \
0 \
.1.3.6.1.4.1.2.6.3.1.... Type attribute \
What kind of slots are available for node down traps and what values
can be filled in then ?
Thanks in advance
*/Marcos Antonio Pezzutti Filho/*
Santander Banespa - Infra-Multiplataforma
É Fone: 5854-6339 Ê Fax: 5538-5260
pezzutti@banespa.com.br <mailto:pezzutti@banespa.com.br>
"Essa mensagem é destinada exclusivamente ao seu destinatário e pode
conter informações confidenciais, protegidas por sigilo profissional ou
cuja divulgação seja proibida por lei. O uso não autorizado de tais
informações é proibido e está sujeito às penalidades cabíveis.
This message is intended exclusively for its addressee and may contain
information that is confidential, protected by a professional
privilege or which disclosure is prohibited by law. Unauthorized use of
such information is prohibited and subject to applicable penalties."
--
Tivoli Certified Consultant & Instructor
Skills 1st Limited, 2 Cedar Chase, Taplow, Bucks, SL6 0EU, UK
Tel: +44 (0)1628 782565
Copyright (c) 2004 Jane Curry <jane.curry@skills-1st.co.uk>. All rights
reserved.
|