Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


HP OPENVIEW NNM

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,72
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> HP OPENVIEW NNM
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 HP OPENVIEW NNM - 5/31/2001 12:54:03 AM   
  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
 
 
Post #: 1
 
 Re: HP OPENVIEW NNM - 5/31/2001 12:55:00 AM   
  countryfun

 

Posts: 12
Score: 0
Joined: 5/31/2001
From: USA
Status: offline
Got the answer, meant to post it a couple of days ago.

To run vbscript under HP OpenView Network Node Manager, you must include "wscript.exe" on the command line, preceding the script you want to execute.

(in reply to countryfun)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> HP OPENVIEW NNM Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts