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
|