Groups | Blog | Home
all groups > dotnet faqs > september 2004 >

dotnet faqs : Monitoring windows service


Wally
9/30/2004 2:46:01 PM
Hi

Hi need to monitoring my windows service written in VB NET.
How can my monitor application "feel" that my service has made something?
Is the only way a polling (for example on a Db table)?
Can't service generate events into monitor application?
Where can I retrieve examples about monitoring windows services?

Thank in advance
and... sorry for my english, but I'm Italian! :-)

VV

Dan Kelley
10/1/2004 12:31:01 AM
One option would be to use .Net remoting. Your service could exposes a number
of methods, via remoting, that can be called by a monitoring application to
check its health. It depends on what you want to do.

Hope this helps.
Dan

[quoted text, click to view]
Jay B. Harlow [MVP - Outlook]
10/1/2004 6:35:18 AM
Wally,
In addition to Dan's comments, you can use WMI (Windows Management
Instrumentation) via the classes in the System.Management namespace to
monitor your windows service.

Here is a recent MSDN article on WMI & .NET:

http://msdn.microsoft.com/vstudio/default.aspx?pull=/library/en-us/dnhcvs04/html/vs04d6a.asp

In addition to/instead of WMI you can also simply use Performance Counters &
Event Logs to keep track of your service doing work. See
System.Diagnostics.EventLog & System.Diagnostics.PerformanceCounter.

Hope this helps
Jay

[quoted text, click to view]

zcsessions NO[at]SPAM visionair.com
10/1/2004 7:40:49 AM
[quoted text, click to view]

That is something I too am interested in so I will be following this
thread with interest. One thing I have discovered, a good way to debug
Wally
10/1/2004 4:32:10 PM

"Zack Sessions" <zcsessions@visionair.com> ha scritto nel messaggio
news:db13d9fb.0410010640.77510215@posting.google.com...
[quoted text, click to view]

Hi!
Event Log could be a good way, but It has limitations: if you want to read
logs not using polling but using events (EntryWritten), you can only read
logs on local machine. Then, I seems to have read that if one log event is
near the log event before (less than 10 sec.) is possible that you won't be
notify.
In my opinion, best way to monitoring service is using Socket or WMI.
Hope this help.

VV

James D. Marshall
10/3/2004 8:06:01 PM
There are a couple of things that can be done.
Monitor the service for state (stopped, stopping, starting started),
Use the Performance counters ( if the service writes them ) to setup
thresholding and alerting, warning, it would be best to watch the counters
for a time, to understand behavior.



[quoted text, click to view]

AddThis Social Bookmark Button