Re: notification from windows

  • From: Hans Forbrich <fuzzy.graybeard@xxxxxxxxx>
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Fri, 22 May 2015 09:58:45 -0600

It is a VB Script. You save it with extension .vbs and you use he cscript or wscript interpreter to execute it,

https://technet.microsoft.com/en-us/library/ee156587.aspx

/Hans

On 22/05/2015 9:48 AM, Zelli, Brian wrote:


Do I save this as a .bat file? I did find something like this from googling but that didn’t work. After I made some changes with the FROM and TO and the smtp, this didn’t work either. Or do I save it as something else and run it differently?

Brian

*From:*David Ramírez Reyes [mailto:dramirezr@xxxxxxxxx]
*Sent:* Friday, May 22, 2015 11:08 AM
*To:* JBECKSTROM@xxxxxxxxx
*Cc:* oracle-l (oracle-l@xxxxxxxxxxxxx); Zelli, Brian
*Subject:* Re: notification from windows

I have a job that checks the result of the last 3 full backups everyday, puts it on a txt file and sends it by email, you can use something like this on vbs file (does not require any installation):

Const ForReading = 1, ForWriting = 2, ForAppending = 8

Dim fso, f

Set fso = CreateObject("Scripting.FileSystemObject")

'Open the file for reading

Set f = fso.OpenTextFile("D:\Alarms\MN3P\output1.txt", ForReading)

'The ReadAll method reads the entire file into the variable BodyText

BodyText = f.ReadAll

'Close the file

f.Close

Set f = Nothing

Set fso = Nothing

Set objEmail = CreateObject("CDO.Message")

objEmail.From = "mesdbas@xxxxxxxx <mailto:mesdbas@xxxxxxxx>"

objEmail.To = "mesdbas@xxxxxxxx <mailto:mesdbas@xxxxxxxx>"

objEmail.Subject = "MES MONT3 DAILY BACKUP REPORT"

objEmail.Textbody = BodyText

objEmail.Configuration.Fields.Item _

("http://schemas.microsoft.com/cdo/configuration/sendusing";) = 2

objEmail.Configuration.Fields.Item _

("http://schemas.microsoft.com/cdo/configuration/smtpserver";) = "smtp.xxxx.com <http://smtp.xxxx.com>"

objEmail.Configuration.Fields.Item _

("http://schemas.microsoft.com/cdo/configuration/smtpserverport";) = 25

objEmail.Configuration.Fields.Update

objEmail.Send


David Ramírez Reyes
Profesión: Padre de Familia

On 22 May 2015 at 08:33, Jeffrey Beckstrom <JBECKSTROM@xxxxxxxxx <mailto:JBECKSTROM@xxxxxxxxx>> wrote:

I use Blat to send smtp email on Windows.

>>> "Zelli, Brian" <Brian.Zelli@xxxxxxxxxxxxxxx <mailto:Brian.Zelli@xxxxxxxxxxxxxxx>> 5/22/15 9:10 AM >>>

I am running a small batch script from windows to check if the instance is up or down. I want to email myself if it is down. I’ve googled a bunch of things(came up with VB, PowerShell, XML) but does anyone have an easy method for what they monitor oracle/windows with? Like a simple mail to: type process?

Brian


This email message may contain legally privileged and/or confidential information. If you are not the intended recipient(s), or the employee or agent responsible for the delivery of this message to the intended recipient(s), you are hereby notified that any disclosure, copying, distribution, or use of this email message is prohibited. If you have received this message in error, please notify the sender immediately by e-mail and delete this email message from your computer. Thank you.

.


This email message may contain legally privileged and/or confidential information. If you are not the intended recipient(s), or the employee or agent responsible for the delivery of this message to the intended recipient(s), you are hereby notified that any disclosure, copying, distribution, or use of this email message is prohibited. If you have received this message in error, please notify the sender immediately by e-mail and delete this email message from your computer. Thank you.

Other related posts: