Solved

Performance alerts Win server 2003 not sending email

Posted on 2010-09-24
26
796 Views
Last Modified: 2013-12-01
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
0
Comment
Question by:gbzhhu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 13
  • 12
26 Comments
 

Expert Comment

by:LifeWay2
ID: 33752171
You could make bat file run as service. (so it would go under start - run - services.msc)
http://support.microsoft.com/kb/137890
0
 
LVL 39

Expert Comment

by:Krzysztof Pytko
ID: 33752175
is in that batch file line which runs VBS file? If so, place before .vbs file name command

cscript <filename>.vbs
0
 
LVL 12

Author Comment

by:gbzhhu
ID: 33752188
LifeWay2,

I'll try that.  Thanks



iSiek,

I already have this

cscript emailMe.vbs

It is not being called!
0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
LVL 12

Author Comment

by:gbzhhu
ID: 33752211

LifeWay2,

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

0
 
LVL 39

Expert Comment

by:Krzysztof Pytko
ID: 33752221
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
 
LVL 12

Author Comment

by:gbzhhu
ID: 33752297
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
 
LVL 39

Expert Comment

by:Krzysztof Pytko
ID: 33752303
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
 
LVL 12

Author Comment

by:gbzhhu
ID: 33752332

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
 
LVL 39

Expert Comment

by:Krzysztof Pytko
ID: 33752434
OK, I made a config and await for mail. I will let you know in 1 hour
0
 
LVL 12

Author Comment

by:gbzhhu
ID: 33752495
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
 
LVL 39

Expert Comment

by:Krzysztof Pytko
ID: 33752882
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
 
LVL 12

Author Comment

by:gbzhhu
ID: 33752927
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
 
LVL 39

Expert Comment

by:Krzysztof Pytko
ID: 33769000
I'm still digging :) It's a challenge :]
0
 
LVL 12

Author Comment

by:gbzhhu
ID: 33769223
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
 
LVL 39

Expert Comment

by:Krzysztof Pytko
ID: 33769320
they only know that :]
0
 
LVL 12

Author Comment

by:gbzhhu
ID: 33769410
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
 
LVL 39

Expert Comment

by:Krzysztof Pytko
ID: 33769520
you ave to try. I had yesterday problems with any applications in performance alerts :/
0
 
LVL 39

Expert Comment

by:Krzysztof Pytko
ID: 33796371
Any progress? I have nothing more to  say :/ This is still doesn't work on my servers :|
0
 
LVL 12

Author Comment

by:gbzhhu
ID: 33796760
Sorry iSiek

I haven't has the time but it is simple.  I will do it now.  Should take 10 minutes max
0
 
LVL 12

Author Comment

by:gbzhhu
ID: 33796869
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
 
LVL 39

Expert Comment

by:Krzysztof Pytko
ID: 33796902
ok, so better is to use simple app wote in c, delphi and run it directly?
thank you in advance
0
 
LVL 12

Author Comment

by:gbzhhu
ID: 33796932
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
 
LVL 39

Expert Comment

by:Krzysztof Pytko
ID: 33797047
if you dont mind :)
0
 
LVL 12

Author Comment

by:gbzhhu
ID: 33797089
No it is cool.  I may have it ready later on today or tomorrow.  Will post back in here when ready
0
 
LVL 39

Expert Comment

by:Krzysztof Pytko
ID: 33797114
thank you
0
 
LVL 12

Accepted Solution

by:
gbzhhu earned 0 total points
ID: 33797594
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

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I previously wrote an article addressing the use of UBCD4WIN and SARDU. All are great, but I have always been an advocate of SARDU. Recently it was suggested that I go back and take a look at Easy2Boot in comparison.
Learn about cloud computing and its benefits for small business owners.
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question