nv-l
[Top] [All Lists]

RE: [NV-L] Trap description not in a varbind

To: Tivoli NetView Discussions <nv-l@lists.ca.ibm.com>
Subject: RE: [NV-L] Trap description not in a varbind
From: James Shanks <jshanks@us.ibm.com>
Date: Thu, 7 Jun 2007 16:45:37 -0400
Delivery-date: Thu, 07 Jun 2007 21:48:40 +0100
Envelope-to: nv-l-archive@lists.skills-1st.co.uk
In-reply-to: <F2D907007615A8498A5D80B15D6331CBCCA4AF@MLNYA223MB.amrs.win.ml.com>
List-help: <mailto:nv-l-request@lists.ca.ibm.com?subject=help>
List-id: Tivoli NetView Discussions <nv-l.lists.ca.ibm.com>
List-post: <mailto:nv-l@lists.ca.ibm.com>
List-subscribe: <http://lists.ca.ibm.com/mailman/listinfo/nv-l>, <mailto:nv-l-request@lists.ca.ibm.com?subject=subscribe>
List-unsubscribe: <http://lists.ca.ibm.com/mailman/listinfo/nv-l>, <mailto:nv-l-request@lists.ca.ibm.com?subject=unsubscribe>
Reply-to: Tivoli NetView Discussions <nv-l@lists.ca.ibm.com>
Sender: nv-l-bounces@lists.ca.ibm.com

The answer to your first question is in the trapd.log. All the numbered varbinds and their contents are shown there. So no, there is no one varbind which contains the trapd.log message. That message is a construction and if you want to use it in your script, then you have to reconstruct it, just as it done by trapd when he combines the variables and the fixed text that are found in trapd.conf for this event log message. Sorry but this is a programming exercise.

As for the rest, I simply don't understand what you are driving at. A ruleset should never end in an in-line action, unless it is on Windows. Is there more to come? An in-line action is executed by nvcorrd himself on UNIX, and if you write an in-line action, then all of the event processing in your event windows and in your TEC adapter will be held up while nvcorrd executes your script. That's usually a bad idea performance-wise unless you can guarantee that your script will finish in under ten seconds. Actions, as opposed to in-line actions, are executed off-line, by actionsvr, and thus do not hold things up.

A script is a script. Why would you have to pass in the string as a parameter when you can just rebuild it inside the script? Can't you just build a string by concatenating variables and text until you have what you need? I'm afraid I don't follow. Can't you do something like this

mystring="The enclosure $NVATTR_5 fan in rack $NVATTR_3 has been"
<full_path><my_other_command> $mystring

right in your script?

I think you are making this harder than it needs to be. Perhaps this will help.

What's going to happen in the Action node or In-line action node is this. The daemon executing it is going to build a script environment as a temp file internally, like this:
#!/bin/ksh
export NVATTR_1=OA-001635C6764A
export NVATTR_2=0
export NVATTR_3=USE063471P
export NVATTR_4=
export NVATTR_5=enclosure460
export NVATTR_6=USE6341KKS
export NVATTR_7=10
export NVATTR_8=
export NVATTR_9=83
.
.
<various other exports listed in the manual, NVE, NVG, NVS, etc>
.
<yourscript> <your hard-coded parameters >
exit

Then it's going to fork this puppy as a process and execute it.

What you have to do is write "yourscript" to access these exported environment variables directly as $NVATTR_n, substituting them where you need them. That's the programming assignment. There is no hidden magic. All we are doing is giving you the opportunity to take the contents of a trap off the wire and have a script of your own design execute using them whenever that trap comes in. The rest is up to you.

HTH


James Shanks
Level 3 Support for Tivoli NetView for UNIX and Windows
Network Availability Management
Network Management - Development
Tivoli Software, IBM Corp
Inactive hide details for "Rivera, Ralph \(GTI\)" <ralph_rivera@ml.com>"Rivera, Ralph \(GTI\)" <ralph_rivera@ml.com>


          "Rivera, Ralph \(GTI\)" <ralph_rivera@ml.com>
          Sent by: nv-l-bounces@lists.ca.ibm.com

          06/07/2007 03:35 PM
          Please respond to
          Tivoli NetView Discussions <nv-l@lists.ca.ibm.com>


To

"Tivoli NetView Discussions" <nv-l@lists.ca.ibm.com>

cc


Subject

RE: [NV-L] Trap description not in a varbind

Hi James,

Thanks for the info. I don't think I was clear in what I need exactly.

1. Is there a variable that exists that contains the whole message string as it appears in trapd.log. I know the $3 and $5 are accessible individually
via varbinds. I wanted to pass this whole string exactly in one variable.

"The enclosure enclosure460 fan in rack USE063471P has been"


2. I know that I can modify the automated action to pass the string above directly to a script. This will not work for me because my rules
require this sequence "Event stream--> Smartset query --> Trap match--> Inline action script"

Is there a way to encode the string in a variable and pass it along with the varbinds which I can then use in my inline action script.
I've seen a previous post of a perl script that interrogates trapd.conf to get the string, but I was hoping I didn't have to go that route.

Ralph Rivera
GTI Systems Monitoring

      -----Original Message-----
      From:
      nv-l-bounces@lists.ca.ibm.com [mailto:nv-l-bounces@lists.ca.ibm.com] On Behalf Of James Shanks
      Sent:
      Thursday, June 07, 2007 2:25 PM
      To:
      Tivoli NetView Discussions
      Subject:
      RE: [NV-L] Trap description not in a varbind

      You reference those as $NVATTR_3 and $NVATTR_5 in the script and execute the script in a Action node. When the Action node fires it will create a new shell with root authority and export all the trap variables in this way. This is covered in the Chapter on Event Customization in the NetView Admin Guide. Look there for more details.

      James Shanks
      Level 3 Support for Tivoli NetView for UNIX and Windows
      Network Availability Management
      Network Management - Development
      Tivoli Software, IBM Corp
      Inactive hide details for "Rivera, Ralph \(GTI\)" <ralph_rivera@ml.com>"Rivera, Ralph \(GTI\)" <ralph_rivera@ml.com>

                      "Rivera, Ralph \(GTI\)" <ralph_rivera@ml.com>
                      Sent by: nv-l-bounces@lists.ca.ibm.com

                      06/07/2007 02:12 PM

      Please respond to
      Tivoli NetView Discussions <nv-l@lists.ca.ibm.com>
      To

      "Tivoli NetView Discussions" <nv-l@lists.ca.ibm.com>
      cc
      Subject

      RE: [NV-L] Trap description not in a varbind

      Thanks Francois,


      If I execute a script via a ruleset how does the script get the vars $3 $5?

      Ralph Rivera
      GTI Systems Monitoring

      -----Original Message-----
      From:
      nv-l-bounces@lists.ca.ibm.com [mailto:nv-l-bounces@lists.ca.ibm.com] On Behalf Of Francois Le Hir
      Sent:
      Thursday, June 07, 2007 12:17 PM
      To:
      Tivoli NetView Discussions
      Subject:
      Re: [NV-L] Trap description not in a varbind

              You can configure an automatic action for that trap with the parameters you need ($3 and $5) in xnmtrap. You can also execute a script in a ruleset.

              Salutations, / Regards,

              Francois Le Hir
              Network Projects & Consulting Services
              IBM Global Technology Services


              "Do not go where the path may lead; go instead where there is no path and leave a trail." - Ralph Waldo Emerson.
              Inactive hide details for "Rivera, Ralph \(GTI\)" <ralph_rivera@ml.com>"Rivera, Ralph \(GTI\)" <ralph_rivera@ml.com>
                                              "Rivera, Ralph \(GTI\)" <ralph_rivera@ml.com>
                                              Sent by: nv-l-bounces@lists.ca.ibm.com

                                              06/07/2007 12:04 PM


              Please respond to
              Tivoli NetView Discussions <nv-l@lists.ca.ibm.com>
              To

              <nv-l@lists.ca.ibm.com>
              cc
              Subject

              [NV-L] Trap description not in a varbind

              How do I get the trap description string as shown in the trap.log sent to a script?

              I am working with an HP c-class device using compaq mib .1.3.6.1.4.1.232 on Netview 7.1.4

              The trapd.log shows:

              1181068515 3 Tue Jun 05 14:35:15 2007 bl460
              A The enclosure enclosure460 fan in rack USE063471P has been removed.

              The varbinds look like this:

              1181068515 3 Tue Jun 05 14:35:15 2007 bl460 A Trap: compaq generic 6 specific 22011
              args (9): [1] mgmt.mib-2.system.sysName.0 (OctetString): OA-001635C6764A

              1181068515 3 Tue Jun 05 14:35:15 2007 bl460 A [2] private.enterprises.232.11.2.11.1 (Integer): 0
              1181068515 3 Tue Jun 05 14:35:15 2007 bl460 A [3] private.enterprises.232.22.2.2.1.1.2.1 (OctetString): USE063471P
              1181068515 3 Tue Jun 05 14:35:15 2007 bl460 A [4] private.enterprises.232.22.2.2.1.1.3.1 (OctetString):
              1181068515 3 Tue Jun 05 14:35:15 2007 bl460 A [5] private.enterprises.232.22.2.3.1.1.1.9.1 (OctetString): enclosure460

              1181068515 3 Tue Jun 05 14:35:15 2007 bl460 A [6] private.enterprises.232.22.2.3.1.1.1.7.1 (OctetString): USE6341KKS
              1181068515 3 Tue Jun 05 14:35:15 2007 bl460 A [7] private.enterprises.232.22.2.3.1.3.1.5.10 (OctetString): 10
              1181068515 3 Tue Jun 05 14:35:15 2007 bl460 A [8] private.enterprises.232.22.2.3.1.3.1.7.10 (OctetString):
              1181068515 3 Tue Jun 05 14:35:15 2007 bl460 A [9] private.enterprises.232.22.2.3.1.1.1.15.1 (Integer): 83

              Regards,
              Ralph Rivera
              GTI Systems Monitoring



              This message w/attachments (message) may be privileged, confidential or proprietary, and if you are not an intended recipient, please notify the sender, do not use or share it and delete it. Unless specifically indicated, this message is not an offer to sell or a solicitation of any investment products or other financial product or service, an official confirmation of any transaction, or an official statement of Merrill Lynch. Subject to applicable law, Merrill Lynch may monitor, review and retain e-communications (EC) traveling through its networks/systems. The laws of the country of each sender/recipient may impact the handling of EC, and EC may be archived, supervised and produced in countries other than the country in which you are located. This message cannot be guaranteed to be secure or error-free. This message is subject to terms available at the following link: http://www.ml.com/e-communications_terms/. By messaging with Merrill Lynch you consent to the foregoing.

              _______________________________________________
              NV-L mailing list
              NV-L@lists.ca.ibm.com
              Unsubscribe:NV-L-leave@lists.ca.ibm.com
              http://lists.ca.ibm.com/mailman/listinfo/nv-l (Browser access limited to internal IBM'ers only)
              _______________________________________________
              NV-L mailing list
              NV-L@lists.ca.ibm.com
              Unsubscribe:NV-L-leave@lists.ca.ibm.com
              http://lists.ca.ibm.com/mailman/listinfo/nv-l (Browser access limited to internal IBM'ers only)_______________________________________________
              NV-L mailing list
              NV-L@lists.ca.ibm.com
              Unsubscribe:NV-L-leave@lists.ca.ibm.com
              http://lists.ca.ibm.com/mailman/listinfo/nv-l (Browser access limited to internal IBM'ers only)

GIF image

_______________________________________________
NV-L mailing list
NV-L@lists.ca.ibm.com
Unsubscribe:NV-L-leave@lists.ca.ibm.com
http://lists.ca.ibm.com/mailman/listinfo/nv-l (Browser access limited to 
internal IBM'ers only)
<Prev in Thread] Current Thread [Next in Thread>

Archive operated by Skills 1st Ltd

See also: The NetView Web