Jay Thomas
asked on
script to send an email alert when a service fails
Hi, got a server behind a firewall, I can't monitor it however it does have access to send SMTP messages . I need a script that sends an email alert support@company.com when and if a service called mccaservice fails.
I'm not a script guy so don't know where to start. Any help much appreciated.
Thanks
I'm not a script guy so don't know where to start. Any help much appreciated.
Thanks
ASKER
Hi Rob, that works brilliantly my friend. I have added it to a schedule job to keep it running after server reboots etc. Can i ask 2 questions. 1. whats does this do:
WScript.Sleep 5000 ' Wait for 5 seconds
If objService.Status <> 4 Then
SendEmail strServer, strTo, strFrom, strSubject, strBody, ""
boolEnd = True
2. How can i onclude 2 email addresses to send to?
Thanks mate.
WScript.Sleep 5000 ' Wait for 5 seconds
If objService.Status <> 4 Then
SendEmail strServer, strTo, strFrom, strSubject, strBody, ""
boolEnd = True
2. How can i onclude 2 email addresses to send to?
Thanks mate.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi, thanks for the explanation, makes sense. And the 2 addresses works as well.
Thanks very much mate.
Thanks very much mate.
Regards,
Rob.
Open in new window