Monitoring windows service

W

Wally

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
 
G

Guest

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
 
J

Jay B. Harlow [MVP - Outlook]

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
 
Z

Zack Sessions

Wally said:
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

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
a Windows Service is to use the Event Log for debugging messages.
 
W

Wally

Zack Sessions said:
"Wally" <[email protected]> wrote in message

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
a Windows Service is to use the Event Log for debugging messages.

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
 
J

James D. Marshall

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.
 

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

Members online

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,828
Latest member
LauraCastr

Latest Threads

Top