Thanks James,
Initially, my script was executed from within the trap customization /
command section and now I want to move the process to a ruleset.
CURRENTLY:
cisco_workgroup 1.3.6.1.4.1.9.5 "LINK_DOWN" Trap
command for automatic action:/usr/local/bin/netview_dore_down $A $4
$A == device name
$4 == port number
The script itself does an snmpget on the device to get the port name. I
took care of all the special characters and such. Generates a popup
messages which contains the device and port name. This process works
ok..
RULESET:
uses the same script. but in the ruleset, the values are not sent so the
script does not work properly. How do I export the values within a
ruleset? I've tried $NVA, $A, and then I read somewhere (cant remember
where) not to export anything in the rulesets that all values are there
but modify the script. I just need the node name and variable 4 sent to
my script.
Other questions:
How do I test a ruleset/trap? server setup?
How do I generate a popup with all the trap values? $* on the popup
notification field.
This is my script:
#!/bin/ksh
# /usr/local/bin/netview_core_down_alert
##############################################
# The script will take a device name and port number
# and produce the port name.
# If the name begins with NET a popup window and email
# are sent.
#-----------------------------------------------------
# The statement below will replace / with an . for port number#
# IN NV712 port numbers exported with _
stamp=`date +"%D-%T"`
port=`echo $2 | tr '_' '.'`
port1=`echo $2 | tr '_' '/'`
#------------------------------------------------------
# the statement below will do an snmpget to get the port name
#
portname=`/usr/OV/bin/snmpget $1 .1.3.6.1.4.1.9.5.1.4.1.1.4.$port`
#-------------------------------------------------------
# Now we take the first 3 letters of the name
name=${portname##*:}
prefix=`echo $name | cut -c 1-4`
#-------------------------------------------------------
#If the 4 letters match NET- then display window and send email
if test "$prefix" = "NET-"
then
/usr/OV/bin/ovxbeep -b 10 -display OPS:0.0 "`echo $stamp $1
reports Port $port1 link to $name is DOWN--Call NWC!| /usr/bin/fold -b
-s -w 18`"&
echo $stamp $1 $name | mail -s "CORE LINK DOWN" online lsg ops
fi
exit 0
-----Original Message-----
From: owner-nv-l@lists.us.ibm.com [mailto:owner-nv-l@lists.us.ibm.com]
On Behalf Of James Shanks
Sent: Wednesday, January 11, 2006 3:50 PM
To: nv-l@lists.us.ibm.com
Subject: Re: [nv-l] Ruleset Question
Since you want to query two different smartsets and take different
actions
depending on the results of those queries, it doesn't really matter
whether
you have two rules or one. The difference in processing will be tiny
because it is the smartset queries that require all the work. I'd stick
with two separate rules because that would be easier to understand and
maintain. You could alter them independently. You'd have more
complicated logic by combining them and you probably wouldn't get a
measurable change in performance in return.
If these rulesets ran in event windows, then nothing would be shown in
those windows because everything is being blocked. But I'm assuming
that
you are planning to run these in ESE.automation, correct? That's the
only
way you could have them both active at the same time. And what you
run
there has no bearing on the operator's display. When the operator opens
her event window it will be running forwardall.rs by default, or
something
else which has an explicit PASS or Forward in it, not one of these.
James Shanks
Level 3 Support for Tivoli NetView for UNIX and Windows
Tivoli Software / IBM Software Group
"Catalina
Martinez"
<Catalina.Martine
To
z@tlc.state.tx.us <nv-l@lists.us.ibm.com>
>
cc
Sent by:
owner-nv-l@lists.
Subject
us.ibm.com [nv-l] Ruleset Question
01/11/2006 04:34
PM
Please respond to
nv-l@lists.us.ibm
.com
Hello,
AIX 5.2 Netview 7.1.4 FP3
General Ruleset question running in ESE.automation:
The rulesets listed below are working ok but wondering if there is more
efficient way of doing this:
do_down.rs -- block --> trap setting = nv60000 node-down --> query
smartset X /if contained in smartset X --> run script A
core_down.rs -- block --> trapsetting == nv6000 node-down --> query
smartset Y/if contained in smartset Y --> run script B
Questions:
1) is it better to have 1 ruleset investigating the same trap; and then
fan out with the different smartset queries /flow. So I would have 2
parallel paths within the same ruleset instead of running 2 separate
rulesets.
2) Does "block" stop the event from the displaying in Main Event window?
The Operators still need to see the event being logged.
3) I normally have "trap setting" first and then the node, can I have
origin first and then the "trap setting". does it matter? which is
better? what's the rule of thumb...
Thanks,
Catalina
|