C # WMI, performance counters and SNMP Oh My!

I have a C # Windows service that listens for MSMQ and sends each message as an email.

Since there is no user interface, I would like to offer the opportunity to track this service in order to see things like # messages in the queue, sent # messages (by message type), number of errors, etc.

What is the best / recommended way to achieve this? Is it WMI or performance counters? Is this data viewed using PerfMon or WMI CIM Studio? Is there any approach to monitoring the service in real time, as well as providing historical analysis?

I myself can figure out the details, but I will be grateful for some broad recommendations to help demystify this topic.

+3
source share
1 answer

I sometimes monitor the performance of my Windows services. What I do, I keep internal counters of things that interest me, and create a way for an external program to access it. This can be a WCF service hosted within a Windows service, which is fairly easy to implement, and various channels can be accessed. The client of this WCF service is also quite easy to do.

Another way is to create your own Windows performance counters that can be read by the event viewer.

, , . MSMQ, , . . WCF . msdn article , . , .

+2

Source: https://habr.com/ru/post/1749410/


All Articles