Quantcast
Channel: THWACK: All Content - Network Performance Monitor
Viewing all articles
Browse latest Browse all 21870

VBScripting notification emails

$
0
0

So I have finally gotten tired of running in circles trying to track this down, and I imagine that someone out there is doing the same thing that I am attempting to do.  So we have this 350 line long VBScript that we used to run in WhatsUp Gold to send out alert emails dependent on the details listed on the device.  This should be a pretty simple transfer from the WUG instance to SolarWinds, however, I am clearly missing something here.  I cannot nail down the variables for SolarWinds to pull information.  I read somewhere to use ${name} however this obviously doesnt work because it isnt even valid VBScript syntax.  I also tried a suggestion somewhere that said to pull from WScript.Arguments and that doesnt work either.  Here is a small script that I was playing with (in this case using the WScript Arguments) to try and test this.  Please advise.

 

option explicit


dim strSMTPTo, strSMTPFrom, strSMTPSubject, strBody, strSMTPNARelay

dim sHostname, objArgs

dim objMessage

 

Set objArgs = WScript.Arguments

Set objMessage = CreateObject("CDO.Message")

 

sHostname = objArgs.Item(0)

strSMTPNARelay = "test.relay"

strSMTPFrom = "solarwinds@domain.com"

strSMTPTo = "admin@domain.com"

strSMTPSubject = "Solarwinds Test Message"

strBody = "This is the hostname or something... " & sHostname

 

objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSMTPNARelay

objMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

objMessage.Configuration.Fields.Update

 

objMessage.From = strSMTPFrom

objMessage.To = strSMTPTo

objMessage.Subject = strSMTPSubject

objMessage.TextBody = strBody

 

objMessage.Send


Viewing all articles
Browse latest Browse all 21870

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>