Solved

Performance alerts Win server 2003 not sending email

Posted on 2010-09-24
26
730 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
  • 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
 
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

A while back when OPSMGR 2012 was released we were very excited about getting it into our environment and upgrading our 2007 implementation,  we started our planning and we then proceeded with our implementation. All went as planned & our system …
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now