[Top] [All Lists]

Re: [nv-l] Rule Set Testing

To: nv-l@lists.us.ibm.com
Subject: Re: [nv-l] Rule Set Testing
From: James Shanks <jshanks@us.ibm.com>
Date: Mon, 26 Apr 2004 09:42:16 -0400
Delivery-date: Mon, 26 Apr 2004 14:49:04 +0100
Envelope-to: nv-l-archive@lists.skills-1st.co.uk
In-reply-to: <DA4A22364E6107449FC788A5DA2872620AD3C5@sapxch10.corp.commenergy.com>
Reply-to: nv-l@lists.us.ibm.com
Sender: owner-nv-l@lists.us.ibm.com

Unless these are NetView traps, and it does not sound as if they are, you cannot use event.  The event command basically simulates NetView traps.  You can get a list of those by issuing "event -l".  See the man page on event for more details on the other options and how to specify them.

But to simulate non-NetView traps, you use snmptrap.  The easiest way is to write a small shell script to issue the command.  That way you have total control over the contents.  Here's a simple example:

# cisco.link.down.trap.sh
# sample shell script James Shanks 07/24/96 to send snmptrap
# for testing Cisco link down
# first hostname is recipient (NetView); second is sender
# hostnames must be valid in your network
# "2 0" indicates link down;  last number is dummy timestamp
# per Cisco the variables are
#    ifIndex       = $1
#    ifDesc        = $2
#    ifType        = $3
#    locIfReason   = $4
/usr/OV/bin/snmptrap  \
 sailor.rtp.lab.tivoli.com  .  \
 ferrari.raleigh.tivoli.com  2 0 1 \
 .  Integer  5  \
 .  OctetString  "Serial2" \
 .  Integer  22  \
 .  OctetString  "standby mode"

Note that the varbind OIDs  ., etc   are entirely made up.  You can send any OID you like.  If you don't care what they are,
then you can just make them simple, like .1.1.0, .1.2.0, .1.3.0 and so on.  trapd and nvcorrd won't care.  All that matters to them is the enterprise id and
the specific trapd id

My guess is that before you test your ruleset you will need a copy of the trap you expect to trigger it.
 You can get that by making the log message for that trap say  "$*" and then trapd will print out all the variables to
the trapd.log.  The you can write your script to duplicate it.  Can't get that?  Then you'll just have to guess.

When you test, don't forget to issue "nvcdebug -d all" first so that nvcorrd will log everything that happens when your
trap is received.

Hope this helps

James Shanks
Level 3 Support  for Tivoli NetView for UNIX and Windows
Tivoli Software / IBM Software Group

"Klingensmith, Debra L." <DKling2@alleghenyenergy.com>
Sent by: owner-nv-l@lists.us.ibm.com

04/26/2004 08:27 AM
Please respond to

[nv-l] Rule Set Testing

I have created a ruleset where I want a script to run when specific traps are received. I would like to test the ruleset. I know you can send a test node down event by using the command event -h nodename -e NDWN_EV. My question is where do I look to find the event name for the traps I would like to test. I cannot look at previous events because none have been generated. These events are for a very critical UPS system and  I cannot wait for an event to happen to make sure things are set up correctly. I am running Netview 7.1.5 on AIX 5.1.0.

Debra L. Klingensmith
Network Specialist
Allegheny Energy
phone: (724) 830-5881
email: dkling2@alleghenyenergy.com

<Prev in Thread] Current Thread [Next in Thread>

Archive operated by Skills 1st Ltd

See also: The NetView Web