nv-l
[Top] [All Lists]

Re: R: [nv-l] problem with nvmail & Windows

To: nv-l@lists.us.ibm.com
Subject: Re: R: [nv-l] problem with nvmail & Windows
From: James Shanks <jshanks@us.ibm.com>
Date: Tue, 15 Mar 2005 08:39:15 -0500
Delivery-date: Tue, 15 Mar 2005 13:40:14 +0000
Envelope-to: nv-l-archive@lists.skills-1st.co.uk
In-reply-to: <!~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAABgAAAAAAAAAJU6qx5E61hGFyQBgl61TwcKAAAAQAAAAFLDgo8qkkU+J7XnKdErxvwEAAAAA@adrtel.it>
Reply-to: nv-l@lists.us.ibm.com
Sender: owner-nv-l@lists.us.ibm.com



I have  no such alternate scripts.  Sorry.  Perhaps someone else does.
Otherwise you will have to get a book or another source on using those
tools and write one yourself.

But I think I the problem is that my example is in error.
What you pass to the  script is $2 (which is the second variable in the
trap).  But the script has only one variable, so that is referenced as %1,
the first passed parameter.  So my final example should have read

C:\usr\ov\bin\nvmail  -server <your_SMTP_server_name>   ^
                          -recipient   <your_e-mail_id>  ^
                -subject "Node Down"  ^
                          -message  "Node Down event  received for node %1"
 Then modify the Trap Settings for Node Down so that the command says
      C:\usr\ov\bin\nvmail.test2.bat  $2

Does this help?
If not, does your Node Down event, as shown in the Event Browser, have a
name shown under the Node column or not?
If you right click the event in the browser window, and select "Event
Details" is there a Node name shown in the detail panel?

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


                                                                           
             "Mauro"                                                       
             <conosciani.m@adr                                             
             tel.it>                                                    To 
             Sent by:                  <nv-l@lists.us.ibm.com>             
             owner-nv-l@lists.                                          cc 
             us.ibm.com                                                    
                                                                   Subject 
                                       R: [nv-l] problem with nvmail &     
             03/15/2005 04:57          Windows                             
             AM                                                            
                                                                           
                                                                           
             Please respond to                                             
                   nv-l                                                    
                                                                           
                                                                           




Thanks for your prompt reply.
Unfortunately I've tried the test you proposed me unsuccessfully.
I mean....point (1) - (2) was OK but (3) no in fact the mail I've received
said

Node Down event  received for node

No variable ($2) appears.......

So it seems to me that the bat way it not the good one.....Just I can't
figure out why I can not use it while Other people can...

To solve the problem could you please suggest me some link where I can find
perl script ???

Cheers

mauro

-----Messaggio originale-----
Da: owner-nv-l@lists.us.ibm.com [mailto:owner-nv-l@lists.us.ibm.com] Per
conto di James Shanks
Inviato: lunedì 14 marzo 2005 18.32
A: nv-l@lists.us.ibm.com
Oggetto: Re: [nv-l] problem with nvmail & Windows





That looks like what you'd get by entering the command from the command
line or opening the bat file; not what you'd get by having it sent by a
trap.
I'd venture to say that your trap cases aren't working at all.

Try a simpler case first.
(1) Verify that you can get nvmail to work from your server from the
command line.
       Build a bat file like this:
      C:\usr\ov\bin\nvmail.exe  -server <your_SMTP_server_name>   ^
                          -recipient   <your_e-mail_id>  ^
                -subject "Test of nvmail"  ^
                          -message  "Test of nvmail was successful from
server <your_SMTP_server_name> "

Call this "nvmail.test1.bat" , put it in \usr\ov\bin, and then just invoke
it from the command line.  If you typed something in wrong, the command
will hang in the window.  If you get the prompt back then it has sent this
to the SMTP server.  Now you just wait for an e-mail response.

(2) Got the e-mail?   Now try it from a trap.
      Use Trap Setting to select the trap you want.  How about Node Down?
In the "Run this command"  window  put in
      C:\usr\ov\bin\nvmail.test1.bat
and click the box to make it run as a Hidden Application.  OK all that.  In
the Event Browser you should see a message that the conf file has been
changed.

Now go to a command window and type in,  "event -e NDWN_EV -h test1".  This
should cause a dummy Node Down event for test1 to be sent.  You should see
it in the Event Browser.  Then you should get the same e-mail message you
got in step one again.


(3) Get that one?  Copy  nvmail.test1.bat to a new file, nvmail.test2.bat.
      C:\usr\ov\bin\nvmail  -server <your_SMTP_server_name>   ^
                          -recipient   <your_e-mail_id>  ^
                -subject "Node Down"  ^
                          -message  "Node Down event  received for node %2"

     Then modify the Trap Settings for Node Down so that the command says
      C:\usr\ov\bin\nvmail.test2.bat  $2

Once you get this, you should be well on your way to making this say
whatever you need to.

The difficulty usually comes when trying to pass in variables which are
strings rather than single elements.  The bat process of substitution does
not lend itself well to that, so it is best to just avoid it if you can, or
to stop using a bat file and write something more sophisticated in  PERL,
TCL, or REXX.     While you are testing, periodically check for nvmail.exe
processes which are just spinning out there.  They can take up as must as a
third of the CPU if they cannot complete, and usually that is a result of
bad syntax from an invalid substitution.    Just kill them and try again.

Hope this helps,



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






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

Archive operated by Skills 1st Ltd

See also: The NetView Web