"BC" <no****@devdex. com> wrote in message
news:eZ******** ******@TK2MSFTN GP10.phx.gbl...
Hi all,
I have a windows service (on client machine) that monitors a MSMQ queue
(on server machine). When a new message is in the server queue, the
client windows service will get the message and does some process.
What I want to do now is create a small windows application that sits on
the client machine and monitor the activities of the windows service.
I am using Visual Studio .NET 2003 with C#.
The question is how can I monitor a windows service? Any related
articles will be great.
Cheers,
Benny
*** Sent via Developersdex http://www.developersdex.com ***
What exactly do you mean with "monitor", if you didn't implement your
service such that it could be monitored there is very little to be
monitored. Sure you can control the state of the service, like starting
stopping etc. but if you need to monitor it's activity you should expose
some objects and/or counters data, lets say the number of MSMQ processed
sent so far.
You have several options depending on your requirements, but you will need
to add some code to your service; the easiest is to publish performance
objects through private performance counters and use the performance monior
to watch these counters.
Another option is to use System.Manageme nt classes to expsose performance
objects or state info by publishing these objects through the WMI system,
this is the way most Msft services like IIS, ASP.NET, SQL Server... publish
their state/performance data. Any client (.NET using System.Manageme nt and
others using COM and or scripting) can be built to query the exposed
objects. Note that the latter option can also be used to manage the service.
Willy.