service monitoring

G

Guy Cohen

Hi all
I would like to write a vb program that senses the status of several windows
services (I wrote them too) and notify in the system-tray when one of them
has stopped or so...
How do I monitor the services status ?

Another question...
Lets say this vb program can show a form with a listview, I would like each
service to have its own listitem and show its progress/status with it.
So - How do I send the service its list item...?

TIA
Guy Cohen
 
G

Guru

Guy Cohen said:
Hi all
I would like to write a vb program that senses the status of several
windows
services (I wrote them too) and notify in the system-tray when one of them
has stopped or so...
How do I monitor the services status ?

You use System.Diagnostics and its custom event logs.

You can use the service's default Application event log (AutoLog) but the
best way is to turn AutoLog off and create a custom log otherwise you'll be
trying to sort out the data you want from any default event or exception
chatter in your service. Create an instance of the EventLog class, register
the events that will write to log and have your service write to your custom
log whenever something happens that you want the service to report on.
Another question...
Lets say this vb program can show a form with a listview, I would like
each
service to have its own listitem and show its progress/status with it.
So - How do I send the service its list item...?

You don't. You write an application to interpret the logs.
 
G

Guy Cohen

Guru said:
You use System.Diagnostics and its custom event logs.

You can use the service's default Application event log (AutoLog) but the
best way is to turn AutoLog off and create a custom log otherwise you'll be
trying to sort out the data you want from any default event or exception
chatter in your service. Create an instance of the EventLog class, register
the events that will write to log and have your service write to your custom
log whenever something happens that you want the service to report on.


You don't. You write an application to interpret the logs.

Guru,
Thanks for the reply -
Look what I found :
http://www.devcity.net/Articles/74/servicecontroller.aspx

Also I believe it will help me with the second question - by sending a
custom command to the service "whats your progress status"

Thanks a lot anyway!

Guy Cohen
 

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