nv-l
[Top] [All Lists]

[nv-l] Re: inline action script?

To: nv-l@lists.us.ibm.com
Subject: [nv-l] Re: inline action script?
From: James Shanks <jshanks@us.ibm.com>
Date: Tue, 14 Oct 2003 10:15:43 -0400
Delivery-date: Tue, 14 Oct 2003 15:24:06 +0100
Envelope-to: nv-l-archive@lists.skills-1st.co.uk
Reply-to: nv-l@lists.us.ibm.com
Sender: owner-nv-l-digest@lists.us.ibm.com

In-line action scripts (and off-line of plain old action scripts) are just k-shell scripts, run by nvcorrd himself (in-line action) or actionsvr (action node).  You can use any scripting language your box supports, PERL, REXX, whatever.  Remember that in-line scripts should be kept very short as you are holding up nvcorrd from processing anything else while he waits for your script to complete.  Off-line, or action node, scripts should be used for all significant processing.  The in-line is there just so you can make a quick go-nogo check of something external to the trap before proceeding.  If it takes more than a second or two, then you may end up with a performance problem under load.

The only programming difference from a normal script is that each daemons  will export the trap variables as environment variables before he launches the script, so that you can reference them without having to pass them.   In the script you can reference  $NVC for the community string, $NVA for the agent address  (hostname), $NVE for the enterprise OID, $NVG for the generic number, $NVS for the specific number , $NVT for the timeticks, and $NVATTR_1 thru $NVATTR_50 for the trap variables, however many there were.

Actionsvr also includes a few more exported variables:  $NVSEV for the event severity, $NVSRC for the event source character, and $NVCAT for the event category, as specified in trapd.conf.   These three additional variables are appended to the actual number of NVATTR_n  trap variables (so if your trap comes with 5 variables, for example, then it will have 8 when these three are added) and there is also a $NVATTR_COUNT which you can reference to get the final total of variables.

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



Tom Hallberg <gimli@hhcrew.tk>

10/14/2003 05:06 AM

       
        To:        James Shanks/Raleigh/IBM@IBMUS
        cc:        nv-l@lists.tivoli.com
        Subject:        inline action script?




Hi

Im searching for some exampels on "inline action" scripts. Or can you just
script as normal and use the arguments like in a normal shell script? Or
do you have to do it in a special way? Its on unix.

Thank you

/Tom Hallberg



<Prev in Thread] Current Thread [Next in Thread>
  • [nv-l] Re: inline action script?, James Shanks <=

Archive operated by Skills 1st Ltd

See also: The NetView Web