nv-l
[Top] [All Lists]

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

To: nv-l@lists.us.ibm.com
Subject: Re: [nv-l] problem with nvmail & Windows
From: James Shanks <jshanks@us.ibm.com>
Date: Mon, 14 Mar 2005 12:31:52 -0500
Delivery-date: Mon, 14 Mar 2005 17:32:37 +0000
Envelope-to: nv-l-archive@lists.skills-1st.co.uk
In-reply-to: <!~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAABgAAAAAAAAAJU6qx5E61hGFyQBgl61TwcKAAAAQAAAAlufWx/EuUEKC0UqlWt0hUAEAAAAA@adrtel.it>
Reply-to: nv-l@lists.us.ibm.com
Sender: owner-nv-l@lists.us.ibm.com



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