Script/utility to detect a specific service stopped and send out e

G

Guest

I have a number of Win2k servers and would like to monitor the "Print
Spooler" service. If the "Print Spooler" service is stopped, the script or
utility can send out an e-mail alert to my Outlook mailbox and restart the
"Print Spooler" service.

Any this kind of script or utility available?
If no, any resource or guideline to guide me to write one myself.
 
P

Pegasus \(MVP\)

Terence said:
I have a number of Win2k servers and would like to monitor the "Print
Spooler" service. If the "Print Spooler" service is stopped, the script or
utility can send out an e-mail alert to my Outlook mailbox and restart the
"Print Spooler" service.

Any this kind of script or utility available?
If no, any resource or guideline to guide me to write one myself.

You could use the Task Scheduler to run the following batch
file once every ten minutes:

@echo off
net start | find /i "Print Spooler" && goto :eof

echo %date% %time% Print spooler failed. >> c:\PrintSpooler.txt
net start "Print Spooler"
set subject="Print Spooler service restarted"
net start | find /i "Print Spooler" || set subject="Failed to restart Print
Spooler service"
blat -.. -.. -.. -Subject "%Subject%"

You can use any number of command line mailers to generate your
message, e.g. blat, mailto, sendmail. They are all freely downloadable
from various sites.
echo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top