Performance alerts Win server 2003 not sending email

Hi,

I have setup a performance monitor alert that monitors hard disk space.  It works fine and writes to the event log when alert is triggered.  What I would like is to send an email to myself too.  I managed to get a vbscript snippet that sends email using Cdonts.  I then created a bat file that calls the script.  On running the bat file I get the email!  The alerts are triggered but the bat file is not run by the performance monitoring system -- I am wondering why?

Cheers
H
LVL 12
gbzhhuAsked:
Who is Participating?
 
gbzhhuConnect With a Mentor Author Commented:
Two files in the attached zip.  Make sure they are both in the same folder.  Change the .config file content to your own set of content and then point performance alerts to the exe and test.  Let me know how you get on
SendEmail.zip
0
 
LifeWay2Commented:
You could make bat file run as service. (so it would go under start - run - services.msc)
http://support.microsoft.com/kb/137890
0
 
Krzysztof PytkoSenior Active Directory EngineerCommented:
is in that batch file line which runs VBS file? If so, place before .vbs file name command

cscript <filename>.vbs
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

 
gbzhhuAuthor Commented:
LifeWay2,

I'll try that.  Thanks



iSiek,

I already have this

cscript emailMe.vbs

It is not being called!
0
 
gbzhhuAuthor Commented:

LifeWay2,

Cannot see NT resource Kit on the server.  It is a Windows 2003 Server

0
 
Krzysztof PytkoSenior Active Directory EngineerCommented:
OK, did you specify user who has access Read&Execute to that batch file?

RK has to be downloaded from Microsoft web site and installed manually on server.
http://www.microsoft.com/Downloads/en/details.aspx?FamilyID=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en
0
 
gbzhhuAuthor Commented:
The user I am using is the administrator of the server - full access to system

Is Resource Kit the way to go?  Do I have to convert a file to service just to be able to run it?
0
 
Krzysztof PytkoSenior Active Directory EngineerCommented:
Nope, you can simply call a batch file. Is it possible to post here that VBS file? I will check it on my test env, and see what could case your problem?
0
 
gbzhhuAuthor Commented:

Set objMessage = CreateObject("CDO.Message") 
objMessage.Subject = "Server space on C: drive is low" 
objMessage.Sender = "webmaster@dbt.co.uk" 
objMessage.To = "user@dbt.co.uk"
objMessage.TextBody = "Server space on C: drive is low - less than 100MB"
 
'==This section provides the configuration information for the remote SMTP server.
'==Normally you will only change the server name or IP.
 
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 
 
'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
 
'Server port (typically 25)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 
 
objMessage.Configuration.Fields.Update
 
'==End remote SMTP server configuration section==
 
objMessage.Send


Calling file I do

cscript emailMe.vbs

Open in new window

0
 
Krzysztof PytkoSenior Active Directory EngineerCommented:
OK, I made a config and await for mail. I will let you know in 1 hour
0
 
gbzhhuAuthor Commented:
Cheers.

My config was to set the alert condition so that as soon as I start alert it gets triggered and that actually works.  Not sure if you have to wait!
0
 
Krzysztof PytkoSenior Active Directory EngineerCommented:
Yes, you're right. But I needed to leave my office for an hour :)
It also doesn't work on my server. I digging now.
0
 
gbzhhuAuthor Commented:
Hahaa I thought you went out for lunch or something.  Glad to hear it is not happening to only me.  Thanks for troubleshooting.  Let's hope you figure out what's happening
0
 
Krzysztof PytkoSenior Active Directory EngineerCommented:
I'm still digging :) It's a challenge :]
0
 
gbzhhuAuthor Commented:
Thanks.

Why did Microsoft not provide interface to send email, surely when things like disk space has run out happen an admin would like an email

0
 
Krzysztof PytkoSenior Active Directory EngineerCommented:
they only know that :]
0
 
gbzhhuAuthor Commented:
I am just tempted to write a quick c# application to send an email but will the alert call my app?  I am not sure!
0
 
Krzysztof PytkoSenior Active Directory EngineerCommented:
you ave to try. I had yesterday problems with any applications in performance alerts :/
0
 
Krzysztof PytkoSenior Active Directory EngineerCommented:
Any progress? I have nothing more to  say :/ This is still doesn't work on my servers :|
0
 
gbzhhuAuthor Commented:
Sorry iSiek

I haven't has the time but it is simple.  I will do it now.  Should take 10 minutes max
0
 
gbzhhuAuthor Commented:
Ok.  Wrote that little test and it worked!  I got emails from the alert :-)  So it must be something to do with scripts - perhaps server security not allowing scripts to run
0
 
Krzysztof PytkoSenior Active Directory EngineerCommented:
ok, so better is to use simple app wote in c, delphi and run it directly?
thank you in advance
0
 
gbzhhuAuthor Commented:
Looks like it.  I will improve my little app so that I can configure who to send it to from config file.  You can have a copy (when I finish) if you have nothing else to go with
0
 
Krzysztof PytkoSenior Active Directory EngineerCommented:
if you dont mind :)
0
 
gbzhhuAuthor Commented:
No it is cool.  I may have it ready later on today or tomorrow.  Will post back in here when ready
0
 
Krzysztof PytkoSenior Active Directory EngineerCommented:
thank you
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.