473,915 Members | 5,813 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Monitoring Service Activity

I have a windows service that in the OnStart it creates a thread and runs a
loop forever and ever, assuming the service is running. The loop stops
during the OnStop event, and everything works exactly as expected.

I also have an application that monitors that service using the
ServiceControll er component, and allows me to start & stop the service as
needed, as well as poll for it's current status. Still everything thus far
works and behaves as expected.

Now I want to add some functionality to the service monitoring application
to get actual useful information from the service, such as what is it
currently doing within the loop.

My idea (not sure if this is correct or not) was to create a new thread
that'll start in the service that will accept and send windows messages back
and forth between the monitoring application. The main processing loop,
everytime it's getting ready to do something would post it's current
activity/status to some variable somewhere that the other thread can pick up
and send (via SendMessage?) to the monitoring app...

Of course this is all hypothetical, assuming I can even do something like
this...

Ideas? Suggestions? Comments? Tips? Pointers??
Nov 17 '05 #1
3 2334
Any ideas or suggestions at all??

"JSheble" <js************ @logicor.com> wrote in message
news:O0******** ******@TK2MSFTN GP10.phx.gbl...
I have a windows service that in the OnStart it creates a thread and runs a
loop forever and ever, assuming the service is running. The loop stops
during the OnStop event, and everything works exactly as expected.

I also have an application that monitors that service using the
ServiceControll er component, and allows me to start & stop the service as
needed, as well as poll for it's current status. Still everything thus
far works and behaves as expected.

Now I want to add some functionality to the service monitoring application
to get actual useful information from the service, such as what is it
currently doing within the loop.

My idea (not sure if this is correct or not) was to create a new thread
that'll start in the service that will accept and send windows messages
back and forth between the monitoring application. The main processing
loop, everytime it's getting ready to do something would post it's current
activity/status to some variable somewhere that the other thread can pick
up and send (via SendMessage?) to the monitoring app...

Of course this is all hypothetical, assuming I can even do something like
this...

Ideas? Suggestions? Comments? Tips? Pointers??

Nov 17 '05 #2

"JSheble" <js************ @logicor.com> wrote in message
news:O0******** ******@TK2MSFTN GP10.phx.gbl...
I have a windows service that in the OnStart it creates a thread and runs a
loop forever and ever, assuming the service is running. The loop stops
during the OnStop event, and everything works exactly as expected.

I also have an application that monitors that service using the
ServiceControll er component, and allows me to start & stop the service as
needed, as well as poll for it's current status. Still everything thus
far works and behaves as expected.

Now I want to add some functionality to the service monitoring application
to get actual useful information from the service, such as what is it
currently doing within the loop.

My idea (not sure if this is correct or not) was to create a new thread
that'll start in the service that will accept and send windows messages
back and forth between the monitoring application. The main processing
loop, everytime it's getting ready to do something would post it's current
activity/status to some variable somewhere that the other thread can pick
up and send (via SendMessage?) to the monitoring app...

Of course this is all hypothetical, assuming I can even do something like
this...

Ideas? Suggestions? Comments? Tips? Pointers??


Have another service thread publishing your service state as WMI class
instances and/or events, a monitoring application can register event
listeners or query the state of the service
Both class instances and events can be produced using System.Manageme nt and
System.Manageme nt.Instrumentat ion, check the docs for details on event
publishing and how to implement instance providers in WMI. Note that this is
the way all MSFT services like SQL/Exchange and ASP.NET are providing
monitoring and instrumentation information.

Willy.

Nov 17 '05 #3

"JSheble" <js************ @logicor.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
ok, thanx... I'll look into it... WMI Event Publishing, right?


Well, you can publish events, but IMO what you are looking for is to publish
instances of .NET classes as WMI classes. The class(es) holds the state of
the service at a certain point in time. Events can be used when a state
changes, for instance when the service is paused you can fire an event so
that the monitor is no longer required to read status instances.

Willy.

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
1644
by: Wally | last post by:
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! :-)
4
2245
by: johnm | last post by:
Hello, We currently are running a CRM application that uses DB/2 7.2 for the data repository. We will be upgrading to 8.2 later this year....maybe....time and resources permitting. The database is currently being hosted with a managed service provider (MSP) at a remote datacenter. This service provider is supposed to be monitoring the health and performance of the database as well as performing proactive maintenance on a regularly...
1
2831
by: Sylesh Nair | last post by:
could anyone give me a possible solution for a Windows Service (in C#) listening to a table in a database for insertion or updation. thanks
0
391
by: Paul Steele | last post by:
I am working in a C# program what monitors the activity on a computer. I have been able to accomplish quite a bit so far, but one item I have not been able to figure out is if there is a way to monitor when a file is opened. The FileSystemWatcher class is useful for monitoring file/directory changes, but all I want is to monitor when a file is opened. Is there any way to do that in .NET? I am also monitoring processes in use on the...
3
3610
by: BC | last post by:
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...
0
1077
by: Scott Daniel | last post by:
Is is possible to do the above? I know there is a mechanism to monitor 'folder' activity and I have used it. But I'm wondering if there is a way of monitoring for CRM or database activity in a similar fashion to how the monitor "folder" function works? Any help is greatly appreciated. Thanks, Scott
4
1545
by: natG | last post by:
Well folks, I didn't heed the warnings (that excessive monitoring, statistics, etc. can cause a performance hit) and I have been playing around with all kinds of monitors, snapshots, especially with the gui. BUT! Performance has dropped 70%! The monitors show that the the most system overhead is caused by these selects themselves. Question 1: Is there a big red switch that turns OFF *all* of this type of activity! Question 2: If so, can I...
2
2446
by: bic1ster | last post by:
I go in through the Control Center Activity Control Center and eventually select view locks, I get a popup window "The Activity Monitor is unable to collect the required snapshot data because the monitor switch "LOCK" is not turned on at the database manager level." I had run db2 update monitor switches using BUFFERPOOL on LOCK on SORT on STATEMENT on TIMESTAMP on TABLE on UOW on Does DB2 need to be restarted? Does das need a restart?
0
1230
by: origami.takarana | last post by:
Dear Reader, Designing for Detection ---------------------------- - Get the right equipment from the start. Make sure all of the features you need, or will need, are available from the start. - Know your environment. Identify potential physical barriers and
0
11354
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10923
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11066
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10542
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9732
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8100
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7256
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6148
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3368
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.