Is there a way to monitor a Windows service and alert people when it hangs/stops? -
we have service running on windows server 2003 machine. service watches particular folder on ftp server, , when files appear there, invokes 1 of few different executables process them.
i've been asked find way staff alerted in way when service hangs or stops.
can suggest information? if not, else need know?
seems write service watch service, there's chance 1 stop ... haven't resolved anything.
about thing know if writing application or service monitors if service running; shouldn't have unexpected behavior , stop, hopefully.
another thing go service in windows, go properties, , go recovery options. here, can set behavior of service if fail. options in windows 7 restart service or computer, or run program. program send sort of notification. however, don't know if or of these options exist in server 2003. not work if service hang, service watching wouldn't either.
also, if have source code, can override of service-related methods such onstop()
(for c#) send notification, don't believe works failure.
my personal choice set recovery options restart service on failure, unless repeatedly fails, there option for. think work best you; there isn't fail-safe method it.
update: did check, , server 2003 indeed have same recovery options in service manager. guys said above, can deal that, in c++ have seen; there command prompt way it:
sc failure [servicename] reset= 0 actions= restart/60000
i found command here , can @ more in msdn documentation. call command c# or other languages if not using c++, or use directly command prompt if not have source code.
Comments
Post a Comment