gbzhhu
asked on
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
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
is in that batch file line which runs VBS file? If so, place before .vbs file name command
cscript <filename>.vbs
cscript <filename>.vbs
ASKER
LifeWay2,
I'll try that. Thanks
iSiek,
I already have this
cscript emailMe.vbs
It is not being called!
I'll try that. Thanks
iSiek,
I already have this
cscript emailMe.vbs
It is not being called!
ASKER
LifeWay2,
Cannot see NT resource Kit on the server. It is a Windows 2003 Server
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
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
ASKER
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?
Is Resource Kit the way to go? Do I have to convert a file to service just to be able to run it?
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?
ASKER
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
OK, I made a config and await for mail. I will let you know in 1 hour
ASKER
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!
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!
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.
It also doesn't work on my server. I digging now.
ASKER
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
I'm still digging :) It's a challenge :]
ASKER
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
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
they only know that :]
ASKER
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!
you ave to try. I had yesterday problems with any applications in performance alerts :/
Any progress? I have nothing more to say :/ This is still doesn't work on my servers :|
ASKER
Sorry iSiek
I haven't has the time but it is simple. I will do it now. Should take 10 minutes max
I haven't has the time but it is simple. I will do it now. Should take 10 minutes max
ASKER
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
ok, so better is to use simple app wote in c, delphi and run it directly?
thank you in advance
thank you in advance
ASKER
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
if you dont mind :)
ASKER
No it is cool. I may have it ready later on today or tomorrow. Will post back in here when ready
thank you
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://support.microsoft.com/kb/137890