| |
countryfun
Posts: 12
Score: 0
Joined: 5/31/2001
From: USA
Status: offline
|
I wrote a small vbscript to handle notifications from HP OpenView NNM. I am running on NNM B.06.10 on NT 4.0. If I run the script from the command line, either with or without arguments, it runs fine. When executed by NNM, it fails with an exit value 1. I have a case open with HP, but so far they are stumped. Does anyone have any idea what could be wrong? My guess is the script, because I am not too well versed in vbscript. Here is the script: ' VBSCRIPT TO SEND MAIL FROM HP OPENVIEW ' ' SET DEFAULTS AND OTHER VARIABLES exec="D:\OpenView\contrib\custom_utils\mailto\mailto.exe" from=" -U OpenView" host=" -H xxxxxx.minolta.com" who=" -D jpapa@minolta.com" ' ' GET COMMAND LINE ARGUMENTS Set objArgs = Wscript.Arguments ' ' Build message if WScript.Arguments.Count = 0 then msg=" -M UNKNOWN_ERROR" end if if WScript.Arguments.Count = 1 then arg1=objArgs.Item(0) msg=" -M " & arg1 end if if WScript.Arguments.Count > 1 then arg2=objArgs.Item(1) msg=msg & "..." & arg2 end if ' ' Build default subject line subj=" -S HP_OpenView_Alert..." & arg1 ' ' Dim MyObj Set MyObj=CreateObject("WScript.Shell") ' ' SET UP MAILING ADDRESSES Call SendIt ' if arg1 = "ecomapp1s" _ or arg1 = "ecomweb2p" _ or arg1 = "ecomsqlp" then subj=subj & "..." & arg2 who=" -D joeblow@minolta.com" Call SendIt who=" -D jamesbond@minolta.com" Call SendIt end if ' if arg1 = "hp01" then who=" -D ajackson@minolta.com" Call SendIt end if ' ' Sub SendIt' ' TEST IF "MAILTO" PROGRAM EXISTS ' if it does not, just echo parameters ' Dim fso Set fso = CreateObject("Scripting.FileSystemObject") If (fso.FileExists(exec)) Then StrMailProg=exec & from & who & host & subj & msg MyObj.Run(StrMailProg) Else Wscript.Echo subj & msg Wscript.Echo who End If End Sub
|
|