To: | nv-l@lists.us.ibm.com |
---|---|
Subject: | RE: [nv-l] monitoring port flapping |
From: | Leslie Clark <lclark@us.ibm.com> |
Date: | Sat, 6 Mar 2004 16:44:34 -0500 |
Delivery-date: | Sat, 06 Mar 2004 22:01:10 +0000 |
Envelope-to: | nv-l-archive@lists.skills-1st.co.uk |
In-reply-to: | <64C7BC5A0ACF044FB7ED82A93FF39333186328@kenmsg31.schp.com> |
Reply-to: | nv-l@lists.us.ibm.com |
Sender: | owner-nv-l@lists.us.ibm.com |
Sanjeev, here are two different examples. You are talking about the second case, but seeing them both will probably help clear up some misunderstanding. All of the information about the trap is available to your script from the environment in "NVxx" variables, so it is not necessary to pass it any variables when you call it, unless you want to. These snippets would be in the scripts your action function calls after the threshold function. =================== Case 1 ================================== #This example is for when you are acting on repeating Netview events # like Interface Down. # First you must clean the escape characters out of the environment # variables. Note that the node that the trap is about is in the second # varbind. The Agent slot ($NVA) also contains that information. NODE=`echo $NVATTR_2 | sed "s:\\\\\\::g"` ADDR=`echo $NVATTR_7 | sed "s:\\\\\\::g"` IFACE=`echo $NVATTR_8 | sed "s:\\\\\\::g"` # Now construct and send your custom trap. This trap has been added to # the Netview Enterprise in trapd.conf as specific trap id 1007 SID=1007 MSG="$NODE interface $IFACE $ADDR is failing repeatedly" /usr/OV/bin/snmptrap $NVSERVER .1.3.6.1.4.1.2.6.3.1 $NODE 6 $SID 1 \ .1.2 Integer 14 \ .1.2 OctetString $NODE \ .1.2 OctetString "$MSG" \ .1.2 OctetString "$ADDR" \ .1.2 OctetString "$IFACE" ====================== Case 2 =============================================== # This example is for when you are acting on repeating unsolicited link down # traps that come from devices. # First you must clean the escape characters out of the environment variables. # Note that the source of the trap is in the Agent variable in this case. NODE=`echo $NVA | sed "s:\\\\\\::g"` # The interface index is usually in the first varbind. There may be more info # in additional varbinds IFINDEX=$NVATTR_1 # Now construct and send your custom trap. This trap has been added to the # Netview Enterprise in trapd.conf as specific trap id 1008 SID=1008 MSG="$NODE interface index $IFINDEX is failing repeatedly" /usr/OV/bin/snmptrap $NVSERVER .1.3.6.1.4.1.2.6.3.1 $NODE 6 $SID 1 \ .1.2 Integer 14 \ .1.2 OctetString $NODE \ .1.2 OctetString "$MSG" \ .1.2 OctetString "$IFINDEX" ================================================================================================ Note that the custom traps should be added by you to trapd.conf. You are free to use the Netview enterprise. Specific trapids 1000 to 1999 are reserved for customer use. In this case I made up the variable bindings with the expection that I might want to be able to refer to them separately some day. Cordially, Leslie A. Clark IBM Global Services - Systems Mgmt & Networking Detroit
Leslie, Could you please share the snmptrap custom trap generated script with me. I'm unable to get the hostname variable into the trap. Thanks in advance sanjeev -----Original Message-----
|
<Prev in Thread] | Current Thread | [Next in Thread> |
---|---|---|
|
Previous by Date: | Re: [nv-l] added router disappears in 30s, Paul |
---|---|
Next by Date: | [nv-l] ^_^ meay-meay!, Klaus . Wich |
Previous by Thread: | [nv-l] added router disappears in 30s, Qureshi, Fawad |
Next by Thread: | RE: [nv-l] monitoring port flapping, Qureshi, Fawad |
Indexes: | [Date] [Thread] [Top] [All Lists] |
Archive operated by Skills 1st Ltd
See also: The NetView Web