9

I have a windows service (.net) that is an implementation of a custom protocol. I need monitor this service from multiple desktop clients (packets arrived, rejected, error, and things like that).

I'm evaluating different alternatives (remoting, socket multicast, etc), but I like to know if this problem have and standard solution. I think this is a very common scenario, if you think in services like IIS, serviced components, etc., you can connect remotely from many clients at the same time and manage the service.

I appreciate suggestions and examples.

Thanks in advance.

skaffman
  • 398,947
  • 96
  • 818
  • 769
Ariel Larraburu
  • 439
  • 1
  • 5
  • 14
  • Possible duplicates: [Communicating with a Windows Service](http://stackoverflow.com/questions/3294502/communicating-with-a-windows-service), [How to communicate with a Win Service](http://stackoverflow.com/questions/84860/how-to-communicate-with-a-windows-service-from-an-application-that-interacts-with), [GUI and Windows Service communication](http://stackoverflow.com/questions/1773046/gui-and-windows-service-communication). Note that most answers suggest **WCF** as the most appropriate strategy. It's pretty simple to use, once you've configured it. – vgru May 06 '11 at 15:23

2 Answers2

7

SNMP.

Quote from wikipedia (I've highlighted the interesting part):

Simple Network Management Protocol (SNMP) is an "Internet-standard protocol for managing devices on IP networks. Devices that typically support SNMP include routers, switches, servers, workstations, printers, modem racks, and more.”1 It is used mostly in network management systems to monitor network-attached devices for conditions that warrant administrative attention

C# implementation: http://www.snmpsharpnet.com/

jgauffin
  • 99,844
  • 45
  • 235
  • 372
  • Wish I could cast more than one upvote. Will be looking at the linked project with great interest. – Tim Coker May 06 '11 at 13:37
  • Hi jgauffin, I have experience with SNMP, is a very complicated approuch. My service is to manage network devices using a protocol more simple than SNMP. SNMP is to manage devices behind the service, not to manage the service, I think. – Ariel Larraburu May 06 '11 at 13:44
  • It seems complicated at first, I agree. But all those numbers are specified for a good reason. Try to look at some code examples (at CodeProject for instancE) and you'll see that it's no magic. The bonus side is that your customers can use any SNMP monitor application to keep track of your applications. And that's a ***big*** sales point. – jgauffin May 06 '11 at 13:48
  • this is an internal solution, I don't need to sell this to anyone more than my boss, and he likes simple solutions. I like pro solutions, then I need a solution that makes us both happy. – Ariel Larraburu May 06 '11 at 13:57
  • Well. If you think that SNMP is too complex, go for WCF. – jgauffin May 06 '11 at 13:59
2

A simple implementation is to use Custom Commands.

You would then be able to use WMI to administer the service with your custom commands.

Aliostad
  • 80,612
  • 21
  • 160
  • 208
  • did not know this, it seems an interesting solution – Ariel Larraburu May 06 '11 at 13:58
  • 1
    @Ariel, @Aliostad: If your intention is to **monitor** the service, I don't see how this will work. You can only pass up to 128 different "commands", from a client towards the service, with no additional parameters. You cannot receive anything from the service this way, so you won't be able to monitor it (if I am not missing something in your answer). – vgru May 06 '11 at 15:16